directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1592736 - /directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
Date Tue, 06 May 2014 13:06:51 GMT
Author: kayyagari
Date: Tue May  6 13:06:51 2014
New Revision: 1592736

URL: http://svn.apache.org/r1592736
Log:
o moved the offset setting lines from deserialize() to readPage()
o made the loadBTree() method package protected to access it from MavibotInspector

Modified:
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java?rev=1592736&r1=1592735&r2=1592736&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
Tue May  6 13:06:51 2014
@@ -749,7 +749,7 @@ public class RecordManager extends Abstr
      * @throws SecurityException
      * @throws IllegalArgumentException
      */
-    private <K, V> void loadBtree( PageIO[] pageIos, BTree btree, BTree<K, V>
parentBTree ) throws EndOfFileExceededException,
+    /* no qualifier */ <K, V> void loadBtree( PageIO[] pageIos, BTree btree, BTree<K,
V> parentBTree ) throws EndOfFileExceededException,
         IOException, ClassNotFoundException, IllegalAccessException, InstantiationException,
IllegalArgumentException, SecurityException, NoSuchFieldException
     {
         long dataPos = 0L;
@@ -859,9 +859,6 @@ public class RecordManager extends Abstr
 
         Page<K, V> page = readPage( btree, rootPageIos );
 
-        ( ( AbstractPage<K, V> ) page ).setOffset( rootPageIos[0].getOffset() );
-        ( ( AbstractPage<K, V> ) page ).setLastOffset( rootPageIos[rootPageIos.length
- 1].getOffset() );
-
         return page;
     }
 
@@ -908,6 +905,12 @@ public class RecordManager extends Abstr
             page = readNodeKeysAndValues( btree, -nbElems, revision, byteBuffer, pageIos
);
         }
 
+        ( ( AbstractPage<K, V> ) page ).setOffset( pageIos[0].getOffset() );
+        if ( pageIos.length > 1 )
+        {
+            ( ( AbstractPage<K, V> ) page ).setLastOffset( pageIos[pageIos.length -
1].getOffset() );
+        }
+
         return page;
     }
 



Mime
View raw message