[rhmessaging-commits] rhmessaging commits: r4195 - store/trunk/cpp/tools.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Aug 9 15:01:28 EDT 2010


Author: kpvdr
Date: 2010-08-09 15:01:28 -0400 (Mon, 09 Aug 2010)
New Revision: 4195

Modified:
   store/trunk/cpp/tools/janal.py
   store/trunk/cpp/tools/resize
Log:
Minor change to tools which speeds up (somewhat) the resize and check_jrnl utilities

Modified: store/trunk/cpp/tools/janal.py
===================================================================
--- store/trunk/cpp/tools/janal.py	2010-08-06 17:20:26 UTC (rev 4194)
+++ store/trunk/cpp/tools/janal.py	2010-08-09 19:01:28 UTC (rev 4195)
@@ -40,17 +40,17 @@
         
     def add(self, fid, hdr, lock = False):
         """Add a new record into the map"""
-        if hdr.rid in self.__map.keys():
+        if hdr.rid in self.__map:
             raise jerr.DuplicateRidError(hdr.rid)
         self.__map[hdr.rid] = (fid, hdr, lock)
     
     def contains(self, rid):
         """Return True if the map contains the given rid"""
-        return rid in self.__map.keys()
+        return rid in self.__map
     
     def delete(self, rid):
         """Delete the rid and its associated data from the map"""
-        if rid in self.__map.keys():
+        if rid in self.__map:
             if self.get_lock(rid):
                 raise jerr.DeleteLockedRecordError(rid)
             del self.__map[rid]
@@ -87,7 +87,7 @@
     
     def lock(self, rid):
         """Set the transaction lock for a given rid to True"""
-        if rid in self.__map.keys():
+        if rid in self.__map:
             tup = self.__map[rid]
             if not tup[2]:
                 self.__map[rid] = (tup[0], tup[1], True)
@@ -126,7 +126,7 @@
     
     def unlock(self, rid):
         """Set the transaction lock for a given rid to False"""
-        if rid in self.__map.keys():
+        if rid in self.__map:
             tup = self.__map[rid]
             if tup[2]:
                 self.__map[rid] = (tup[0], tup[1], False)
@@ -154,14 +154,14 @@
         """Add a new transactional record into the map"""
         if isinstance(hdr, jrnl.DeqRec):
             self.__emap.lock(hdr.deq_rid)
-        if hdr.xid in self.__map.keys():
+        if hdr.xid in self.__map:
             self.__map[hdr.xid].append((fid, hdr)) # append to existing list
         else:
             self.__map[hdr.xid] = [(fid, hdr)] # create new list
     
     def contains(self, xid):
         """Return True if the xid exists in the map; False otherwise"""
-        return xid in self.__map.keys()
+        return xid in self.__map
     
     def delete(self, hdr):
         """Remove a transaction record from the map using either a commit or abort header"""

Modified: store/trunk/cpp/tools/resize
===================================================================
--- store/trunk/cpp/tools/resize	2010-08-06 17:20:26 UTC (rev 4194)
+++ store/trunk/cpp/tools/resize	2010-08-09 19:01:28 UTC (rev 4195)
@@ -118,7 +118,7 @@
             hdr = tup[1]
             hdr.flags &= ~jrnl.Hdr.OWI_MASK # Turn off owi
             master_record_list[long(hdr.rid)] = hdr
-            if hdr.xidsize > 0 and hdr.xid in txn_record_list.keys():
+            if hdr.xidsize > 0 and hdr.xid in txn_record_list:
                 txn_hdr = txn_record_list[hdr.xid]
                 del(txn_record_list[hdr.xid])
                 txn_hdr.flags &= ~jrnl.Hdr.OWI_MASK # Turn off owi



More information about the rhmessaging-commits mailing list