Author: elecharny
Date: Mon Mar  4 18:15:45 2013
New Revision: 1452426

URL: http://svn.apache.org/r1452426
Log:
o Commented some not functional code
o Fixed a bug in the pagePosition computation in storeBytes

Modified:
    
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/store/RecordManager.java

Modified: 
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/store/RecordManager.java
URL: 
http://svn.apache.org/viewvc/labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/store/RecordManager.java?rev=1452426&r1=1452425&r2=1452426&view=diff
==============================================================================
--- 
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/store/RecordManager.java
 (original)
+++ 
labs/mavibot/trunk/mavibot/src/main/java/org/apache/mavibot/btree/store/RecordManager.java
 Mon Mar  4 18:15:45 2013
@@ -323,7 +323,7 @@ public class RecordManager
         // - The RootPage offset
         PageIO rootPageIo = fetchNewPage();
 
-        long position = storeBytes( pageIos, 0, btreeNameBytes ); // The tree 
name
+        //long position = storeBytes( pageIos, 0, btreeNameBytes ); // The 
tree name
         /*btreeNameBytes,
         IntSerializer.serialize( keySerializerBytes.length ), // The 
keySerializer name
         keySerializerBytes,
@@ -336,8 +336,8 @@ public class RecordManager
         */
 
         // And flush the pages to disk now
-        flushPages( pageIos );
-        flushPages( rootPageIo );
+        //flushPages( pageIos );
+        //flushPages( rootPageIo );
     }
 
 
@@ -385,6 +385,13 @@ public class RecordManager
     }
 
 
+    /**
+     * 
+     * @param pageIos
+     * @param position
+     * @param bytes
+     * @return
+     */
     private long storeBytes( PageIO[] pageIos, long position, byte[] bytes )
     {
         if ( bytes != null )
@@ -458,7 +465,7 @@ public class RecordManager
         int pageNb = computePageNb( position );
 
         // Compute the position in the current page
-        int pagePos = ( int ) ( position - pageNb * pageSize - ( pageNb + 1 ) 
* 8 - 4 );
+        int pagePos = ( int ) ( position + ( pageNb + 1 ) * 8 + 4 ) - pageNb * 
pageSize;
 
         // Get back the buffer in this page
         ByteBuffer pageData = pageIos[pageNb].getData();
@@ -780,6 +787,15 @@ public class RecordManager
     }
 
 
+    /**
+     * @return the pageSize
+     */
+    public int getPageSize()
+    {
+        return pageSize;
+    }
+
+
     public void setPageSize( int pageSize )
     {
         if ( this.pageSize != -1 )



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to