directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1811808 - /directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java
Date Wed, 11 Oct 2017 10:08:59 GMT
Author: elecharny
Date: Wed Oct 11 10:08:59 2017
New Revision: 1811808

URL: http://svn.apache.org/viewvc?rev=1811808&view=rev
Log:
o Don't store temporary pages in the CPB map
o Update the btreeMap when a BTree header has been updated

Modified:
    directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java

Modified: directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java?rev=1811808&r1=1811807&r2=1811808&view=diff
==============================================================================
--- directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java
(original)
+++ directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/WriteTransaction.java
Wed Oct 11 10:08:59 2017
@@ -129,6 +129,15 @@ public class WriteTransaction extends Ab
                 if ( walObject.isBTreeUser() )
                 {
                     btreeInfos.add( btreeInfo );
+
+                    // Also update the recordManagerHeader B-tree map
+                    if ( walObject instanceof BTreeHeader )
+                    {
+                        BTree btree = recordManagerHeader.btreeMap.get( btreeInfo.getName()
);
+                        BTree newBtree = btree.copy();
+                        newBtree.setBtreeHeader( ( BTreeHeader ) walObject );
+                        recordManagerHeader.btreeMap.put( btreeInfo.getName(), newBtree );
+                    }
                 }
             }
             
@@ -298,7 +307,7 @@ public class WriteTransaction extends Ab
      */
     /* No qualifier */<K, V> void addCopiedWALObject( WALObject<K, V> walObject
)
     {
-        if ( ( walObject != null ) && !copiedPageMap.containsKey( walObject.getId()
) )
+        if ( ( walObject != null ) && ( walObject.getOffset() != BTreeConstants.NO_PAGE
) && !copiedPageMap.containsKey( walObject.getId() ) )
         {
             copiedPageMap.put( walObject.getId(), walObject );
         }



Mime
View raw message