directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551319 [1/2] - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ main/java/org/apache/directory/mavibot/btree/memory/ main/java/org/apache/directory/mavibot/btree/persisted/ test/java/org/apache/direct...
Date Mon, 16 Dec 2013 19:18:37 GMT
Author: elecharny
Date: Mon Dec 16 19:18:36 2013
New Revision: 1551319

URL: http://svn.apache.org/r1551319
Log:
Moved around many classes in order to be able to package protect them (and their methods)

Added:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTree.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilder.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfiguration.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeConfiguration.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeFactory.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeFactory.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryLeaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryNode.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryNode.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryValueHolder.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryValueHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PageIO.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PageIO.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilder.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeFactory.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeFactory.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedKeyHolder.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedKeyHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedLeaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedNode.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java
      - copied, changed from r1551187, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedPageHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java
      - copied, changed from r1551187, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedValueHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/RecordManager.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfigurationTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeConfigurationTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java
      - copied, changed from r1551280, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java
      - copied, changed from r1551294, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedReadTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/ReadTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedStoreTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/StoreTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerPrivateMethodTest.java
      - copied, changed from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/RecordManagerPrivateMethodTest.java
Removed:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeConfiguration.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeFactory.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryLeaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryNode.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryValueHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeFactory.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PageIO.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTree.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedKeyHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedLeaf.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedNode.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedPageHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedValueHolder.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/RecordManager.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeConfigurationTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/ReadTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/RecordManagerPrivateMethodTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/StoreTest.java
Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BulkDataSorter.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeConfiguration.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BulkDataSorter.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeBuilderTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/BTreeDuplicateKeyTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBrowseTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilderTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/RecordManagerFreePageTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/RecordManagerTest.java
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/persisted/RecordManagerWithDuplicatesTest.java

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTree.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTree.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTree.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTree.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTree.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTree.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTree.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.Closeable;
@@ -34,22 +34,8 @@ import java.util.concurrent.locks.Reentr
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.config.CacheConfiguration;
 
-import org.apache.directory.mavibot.btree.AbstractBTree;
-import org.apache.directory.mavibot.btree.Addition;
-import org.apache.directory.mavibot.btree.BTreeHeader;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.Deletion;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.Modification;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Transaction;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
+import org.apache.directory.mavibot.btree.memory.BTreeTypeEnum;
 import org.apache.directory.mavibot.btree.serializer.BufferHandler;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
@@ -65,7 +51,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class InMemoryBTree<K, V> extends AbstractBTree<K, V> implements Closeable
+ class InMemoryBTree<K, V> extends AbstractBTree<K, V> implements Closeable
 {
     /** The LoggerFactory used by this class */
     protected static final Logger LOG = LoggerFactory.getLogger( InMemoryBTree.class );
@@ -114,7 +100,7 @@ public class InMemoryBTree<K, V> extends
      * 
      * @param comparator The comparator to use
      */
-    public InMemoryBTree( BTreeConfiguration<K, V> configuration ) throws IOException
+    public InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ) throws IOException
     {
         super();
         String name = configuration.getName();
@@ -414,7 +400,7 @@ public class InMemoryBTree<K, V> extends
             if ( result instanceof RemoveResult )
             {
                 // The element was found, and removed
-                RemoveResult<K, V> removeResult = (org.apache.directory.mavibot.btree.RemoveResult<K, V> ) result;
+                RemoveResult<K, V> removeResult = (RemoveResult<K, V> ) result;
 
                 Page<K, V> modifiedPage = removeResult.getModifiedPage();
 
@@ -477,7 +463,7 @@ public class InMemoryBTree<K, V> extends
 
         if ( result instanceof ModifyResult )
         {
-            ModifyResult<K, V> modifyResult = ( (org.apache.directory.mavibot.btree.ModifyResult<K, V> ) result );
+            ModifyResult<K, V> modifyResult = ( (ModifyResult<K, V> ) result );
 
             Page<K, V> modifiedPage = modifyResult.getModifiedPage();
 
@@ -491,7 +477,7 @@ public class InMemoryBTree<K, V> extends
         {
             // We have split the old root, create a new one containing
             // only the pivotal we got back
-            SplitResult<K, V> splitResult = ( (org.apache.directory.mavibot.btree.SplitResult<K, V> ) result );
+            SplitResult<K, V> splitResult = ( (SplitResult<K, V> ) result );
 
             K pivot = splitResult.getPivot();
             Page<K, V> leftPage = splitResult.getLeftPage();

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilder.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeBuilder.java Mon Dec 16 19:18:36 2013
@@ -18,13 +18,13 @@
  *
  */
 
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
-import static org.apache.directory.mavibot.btree.memory.BTreeFactory.createLeaf;
-import static org.apache.directory.mavibot.btree.memory.BTreeFactory.createNode;
-import static org.apache.directory.mavibot.btree.memory.BTreeFactory.setKey;
-import static org.apache.directory.mavibot.btree.memory.BTreeFactory.setValue;
+import static org.apache.directory.mavibot.btree.InMemoryBTreeFactory.createLeaf;
+import static org.apache.directory.mavibot.btree.InMemoryBTreeFactory.createNode;
+import static org.apache.directory.mavibot.btree.InMemoryBTreeFactory.setKey;
+import static org.apache.directory.mavibot.btree.InMemoryBTreeFactory.setValue;
 
 import java.io.IOException;
 import java.lang.reflect.Array;
@@ -32,13 +32,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.PageHolder;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 
@@ -108,7 +101,8 @@ public class InMemoryBTreeBuilder<K, V>
         }
 
         // remove null keys and values from the last leaf and resize
-        InMemoryLeaf<K, V> lastLeaf = ( InMemoryLeaf<K, V> ) lstLeaves.get( lstLeaves.size() - 1 );
+        InMemoryLeaf<K, V> lastLeaf = (InMemoryLeaf<K, V> ) lstLeaves.get( lstLeaves.size() - 1 );
+        
         for ( int i = 0; i < lastLeaf.getNbElems(); i++ )
         {
             if ( lastLeaf.getKeys()[i] == null )
@@ -121,7 +115,7 @@ public class InMemoryBTreeBuilder<K, V>
                 System.arraycopy( keys, 0, lastLeaf.getKeys(), 0, n );
 
                 ValueHolder<V>[] values = lastLeaf.values;
-                lastLeaf.values = ( InMemoryValueHolder<V>[] ) Array.newInstance( InMemoryValueHolder.class, n );
+                lastLeaf.values = (InMemoryValueHolder<V>[] ) Array.newInstance( InMemoryValueHolder.class, n );
                 System.arraycopy( values, 0, lastLeaf.values, 0, n );
 
                 break;

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfiguration.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeConfiguration.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfiguration.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfiguration.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeConfiguration.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeConfiguration.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfiguration.java Mon Dec 16 19:18:36 2013
@@ -17,9 +17,10 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
+import org.apache.directory.mavibot.btree.memory.BTreeTypeEnum;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 
@@ -32,7 +33,7 @@ import org.apache.directory.mavibot.btre
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BTreeConfiguration<K, V>
+public class InMemoryBTreeConfiguration<K, V>
 {
     /** Number of entries in each Page. */
     private int pageSize = InMemoryBTree.DEFAULT_PAGE_SIZE;

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeFactory.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeFactory.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeFactory.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeFactory.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeFactory.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeFactory.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryBTreeFactory.java Mon Dec 16 19:18:36 2013
@@ -17,19 +17,12 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.util.LinkedList;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.PageHolder;
-import org.apache.directory.mavibot.btree.ParentPos;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 
@@ -41,7 +34,7 @@ import org.apache.directory.mavibot.btre
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BTreeFactory
+public class InMemoryBTreeFactory
 {
     /**
      * Create a new BTree.
@@ -238,13 +231,13 @@ public class BTreeFactory
 
         if ( btree.getRootPage() instanceof InMemoryLeaf )
         {
-            InMemoryLeaf<K, V> leaf = ( InMemoryLeaf<K, V> ) ( btree.getRootPage() );
+            InMemoryLeaf<K, V> leaf = (InMemoryLeaf<K, V> ) ( btree.getRootPage() );
             ValueHolder<V> valueHolder = leaf.values[last.pos];
             last.valueCursor = valueHolder.getCursor();
         }
         else
         {
-            InMemoryNode<K, V> node = ( InMemoryNode<K, V> ) btree.getRootPage();
+            InMemoryNode<K, V> node = (InMemoryNode<K, V> ) btree.getRootPage();
 
             while ( true )
             {
@@ -255,7 +248,7 @@ public class BTreeFactory
 
                 if ( p instanceof InMemoryLeaf )
                 {
-                    InMemoryLeaf<K, V> leaf = ( InMemoryLeaf<K, V> ) ( last.page );
+                    InMemoryLeaf<K, V> leaf = (InMemoryLeaf<K, V> ) ( last.page );
                     ValueHolder<V> valueHolder = leaf.values[last.pos];
                     last.valueCursor = valueHolder.getCursor();
                     break;

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryLeaf.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryLeaf.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryLeaf.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java Mon Dec 16 19:18:36 2013
@@ -17,31 +17,12 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.lang.reflect.Array;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.MergedWithSiblingResult;
-import org.apache.directory.mavibot.btree.TupleCursor;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
-import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.ParentPos;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Transaction;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.ValueCursor;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 
@@ -83,7 +64,7 @@ import org.apache.directory.mavibot.btre
     {
         super( btree, revision, nbElems );
 
-        this.values = ( InMemoryValueHolder<V>[] ) Array.newInstance( InMemoryValueHolder.class, nbElems );
+        this.values = (InMemoryValueHolder<V>[] ) Array.newInstance( InMemoryValueHolder.class, nbElems );
     }
 
 
@@ -232,8 +213,8 @@ import org.apache.directory.mavibot.btre
                 // if it has more than N/2 elements, or to merge the two pages.
                 // Check in both next and previous page, if they have the same parent
                 // and select the biggest page with the same parent to borrow an element.
-                int siblingPos = selectSibling( ( InMemoryNode<K, V> ) parent, parentPos );
-                InMemoryLeaf<K, V> sibling = ( InMemoryLeaf<K, V> ) ( ( ( InMemoryNode<K, V> ) parent ).getPage( siblingPos ) );
+                int siblingPos = selectSibling( (InMemoryNode<K, V> ) parent, parentPos );
+                InMemoryLeaf<K, V> sibling = (InMemoryLeaf<K, V> ) ( ( (InMemoryNode<K, V> ) parent ).getPage( siblingPos ) );
 
                 if ( sibling.getNbElems() == halfSize )
                 {
@@ -369,7 +350,7 @@ import org.apache.directory.mavibot.btre
         ValueHolder<V> siblingValue = sibling.values[sibling.getNbElems() - 1];
 
         // Create the new sibling, with one less element at the end
-        InMemoryLeaf<K, V> newSibling = ( InMemoryLeaf<K, V> ) sibling.copy( revision, sibling.getNbElems() - 1 );
+        InMemoryLeaf<K, V> newSibling = (InMemoryLeaf<K, V> ) sibling.copy( revision, sibling.getNbElems() - 1 );
 
         // Create the new page and add the new element at the beginning
         // First copy the current page, with the same size
@@ -493,7 +474,7 @@ import org.apache.directory.mavibot.btre
 
         if ( pos < 0 )
         {
-            InMemoryValueHolder<V> valueHolder = ( InMemoryValueHolder<V> ) values[-( pos + 1 )];
+            InMemoryValueHolder<V> valueHolder = (InMemoryValueHolder<V> ) values[-( pos + 1 )];
             
             V value = valueHolder.getCursor().next();
             
@@ -521,7 +502,7 @@ import org.apache.directory.mavibot.btre
 
         if ( pos < 0 )
         {
-            InMemoryValueHolder<V> valueHolder = ( InMemoryValueHolder<V> ) values[-( pos + 1 )];
+            InMemoryValueHolder<V> valueHolder = (InMemoryValueHolder<V> ) values[-( pos + 1 )];
 
             return valueHolder.getCursor();
         }
@@ -733,7 +714,7 @@ import org.apache.directory.mavibot.btre
         if ( this.revision != revision )
         {
             // The page hasn't been modified yet, we need to copy it first
-            newLeaf = ( InMemoryLeaf<K, V> ) copy( revision, nbElems );
+            newLeaf = (InMemoryLeaf<K, V> ) copy( revision, nbElems );
         }
 
         // Get the previous value from the leaf (it's a copy)

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryNode.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryNode.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryNode.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryNode.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryNode.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryNode.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryNode.java Mon Dec 16 19:18:36 2013
@@ -17,30 +17,13 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
-import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
-import org.apache.directory.mavibot.btree.BorrowedFromSiblingResult;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.MergedWithSiblingResult;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.PageHolder;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * A MVCC Node. It stores the keys and references to its children page. It does not
@@ -129,13 +112,13 @@ import org.apache.directory.mavibot.btre
         if ( result instanceof ModifyResult )
         {
             // The child has been modified.
-            return replaceChild( revision, (org.apache.directory.mavibot.btree.ModifyResult<K, V> ) result, pos );
+            return replaceChild( revision, (ModifyResult<K, V> ) result, pos );
         }
         else
         {
             // The child has been split. We have to insert the new pivot in the
             // current page, and to reference the two new pages
-            SplitResult<K, V> splitResult = (org.apache.directory.mavibot.btree.SplitResult<K, V> ) result;
+            SplitResult<K, V> splitResult = (SplitResult<K, V> ) result;
             K pivot = splitResult.getPivot();
             Page<K, V> leftPage = splitResult.getLeftPage();
             Page<K, V> rightPage = splitResult.getRightPage();
@@ -583,7 +566,7 @@ import org.apache.directory.mavibot.btre
         // the current page
         if ( deleteResult instanceof BorrowedFromSiblingResult )
         {
-            RemoveResult<K, V> removeResult = handleBorrowedResult( (org.apache.directory.mavibot.btree.BorrowedFromSiblingResult<K, V> ) deleteResult,
+            RemoveResult<K, V> removeResult = handleBorrowedResult( (BorrowedFromSiblingResult<K, V> ) deleteResult,
                 pos );
 
             return removeResult;
@@ -593,7 +576,7 @@ import org.apache.directory.mavibot.btre
         // an element from the local page, and to deal with the result.
         if ( deleteResult instanceof MergedWithSiblingResult )
         {
-            MergedWithSiblingResult<K, V> mergedResult = (org.apache.directory.mavibot.btree.MergedWithSiblingResult<K, V> ) deleteResult;
+            MergedWithSiblingResult<K, V> mergedResult = (MergedWithSiblingResult<K, V> ) deleteResult;
 
             // If the parent is null, then this page is the root page.
             if ( parent == null )
@@ -621,9 +604,9 @@ import org.apache.directory.mavibot.btre
                 // We will remove one element from a page that will have less than N/2 elements,
                 // which will lead to some reorganization : either we can borrow an element from
                 // a sibling, or we will have to merge two pages
-                int siblingPos = selectSibling( ( InMemoryNode<K, V> ) parent, parentPos );
+                int siblingPos = selectSibling( (InMemoryNode<K, V> ) parent, parentPos );
 
-                InMemoryNode<K, V> sibling = ( InMemoryNode<K, V> ) ( ( ( InMemoryNode<K, V> ) parent ).children[siblingPos].getValue() );
+                InMemoryNode<K, V> sibling = (InMemoryNode<K, V> ) ( ( (InMemoryNode<K, V> ) parent ).children[siblingPos].getValue() );
 
                 if ( sibling.getNbElems() > halfSize )
                 {
@@ -826,7 +809,7 @@ import org.apache.directory.mavibot.btre
         // to point on the modified child
         Page<K, V> modifiedPage = result.getModifiedPage();
 
-        ( ( InMemoryNode<K, V> ) newPage ).children[pos] = new PageHolder<K, V>( btree, modifiedPage );
+        ( (InMemoryNode<K, V> ) newPage ).children[pos] = new PageHolder<K, V>( btree, modifiedPage );
 
         // We can return the result, where we update the modifiedPage,
         // to avoid the creation of a new object

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryValueHolder.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryValueHolder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryValueHolder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryValueHolder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryValueHolder.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryValueHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryValueHolder.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
@@ -25,9 +25,6 @@ import java.lang.reflect.Array;
 import java.util.Comparator;
 import java.util.UUID;
 
-import org.apache.directory.mavibot.btree.AbstractValueHolder;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 
 
@@ -126,7 +123,7 @@ public class InMemoryValueHolder<V> exte
     {
         try
         {
-            BTreeConfiguration<V, V> configuration = new BTreeConfiguration<V, V>();
+            InMemoryBTreeConfiguration<V, V> configuration = new InMemoryBTreeConfiguration<V, V>();
             configuration.setAllowDuplicates( false );
             configuration.setName( UUID.randomUUID().toString() );
             configuration.setKeySerializer( valueSerializer );

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PageIO.java (from r1551070, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PageIO.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PageIO.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PageIO.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PageIO.java&r1=1551070&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PageIO.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PageIO.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.nio.ByteBuffer;

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTree.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTree.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTree.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTree.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.Closeable;
@@ -30,19 +30,8 @@ import java.util.concurrent.locks.Reentr
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.config.CacheConfiguration;
 
-import org.apache.directory.mavibot.btree.AbstractBTree;
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTreeHeader;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Transaction;
-import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
+import org.apache.directory.mavibot.btree.persisted.BTreeConfiguration;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -445,12 +434,12 @@ public class PersistedBTree<K, V> extend
                     revision );
 
                 // Store the offset on disk in the page in memory
-                ( ( AbstractPage<K, V> ) modifiedPage ).setOffset( ( ( PersistedPageHolder<K, V> ) holder )
+                ( ( AbstractPage<K, V> ) modifiedPage ).setOffset( ( (PersistedPageHolder<K, V> ) holder )
                     .getOffset() );
 
                 // Store the last offset on disk in the page in memory
                 ( ( AbstractPage<K, V> ) modifiedPage )
-                    .setLastOffset( ( ( PersistedPageHolder<K, V> ) holder )
+                    .setLastOffset( ( (PersistedPageHolder<K, V> ) holder )
                         .getLastOffset() );
 
                 // This is a new root

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilder.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilder.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedBTreeBuilder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilder.java Mon Dec 16 19:18:36 2013
@@ -18,13 +18,13 @@
  *
  */
 
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
-import static org.apache.directory.mavibot.btree.persisted.BTreeFactory.createLeaf;
-import static org.apache.directory.mavibot.btree.persisted.BTreeFactory.createNode;
-import static org.apache.directory.mavibot.btree.persisted.BTreeFactory.setKey;
-import static org.apache.directory.mavibot.btree.persisted.BTreeFactory.setValue;
+import static org.apache.directory.mavibot.btree.PersistedBTreeFactory.createLeaf;
+import static org.apache.directory.mavibot.btree.PersistedBTreeFactory.createNode;
+import static org.apache.directory.mavibot.btree.PersistedBTreeFactory.setKey;
+import static org.apache.directory.mavibot.btree.PersistedBTreeFactory.setValue;
 
 import java.io.IOException;
 import java.lang.reflect.Array;
@@ -33,12 +33,6 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 
@@ -103,7 +97,7 @@ public class PersistedBTreeBuilder<K, V>
             {
                 leafIndex = 0;
                 
-                PersistedPageHolder<K, V> pageHolder = ( PersistedPageHolder<K, V> ) rm.writePage( btree, leaf1, 1 );
+                PersistedPageHolder<K, V> pageHolder = (PersistedPageHolder<K, V> ) rm.writePage( btree, leaf1, 1 );
                 
                 leaf1 = createLeaf( btree, 0, numKeysInNode );
                 lstLeaves.add( leaf1 );
@@ -118,7 +112,7 @@ public class PersistedBTreeBuilder<K, V>
         }
 
         // remove null keys and values from the last leaf and resize
-        PersistedLeaf<K, V> lastLeaf = ( PersistedLeaf<K, V> ) lstLeaves.get( lstLeaves.size() - 1 );
+        PersistedLeaf<K, V> lastLeaf = (PersistedLeaf<K, V> ) lstLeaves.get( lstLeaves.size() - 1 );
         for ( int i = 0; i < lastLeaf.getNbElems(); i++ )
         {
             if ( lastLeaf.getKey( i ) == null )
@@ -131,10 +125,10 @@ public class PersistedBTreeBuilder<K, V>
                 System.arraycopy( keys, 0, lastLeaf.getKeys(), 0, n );
 
                 ValueHolder<V>[] values = lastLeaf.values;
-                lastLeaf.values = ( PersistedValueHolder<V>[] ) Array.newInstance( PersistedValueHolder.class, n );
+                lastLeaf.values = (PersistedValueHolder<V>[] ) Array.newInstance( PersistedValueHolder.class, n );
                 System.arraycopy( values, 0, lastLeaf.values, 0, n );
 
-                PersistedPageHolder<K, V> pageHolder = ( PersistedPageHolder<K, V> ) rm.writePage( btree, lastLeaf, 1 );
+                PersistedPageHolder<K, V> pageHolder = (PersistedPageHolder<K, V> ) rm.writePage( btree, lastLeaf, 1 );
 
                 break;
             }
@@ -190,7 +184,7 @@ public class PersistedBTreeBuilder<K, V>
             {
                 i = 0;
                 
-                PersistedPageHolder<K, V> pageHolder = ( PersistedPageHolder<K, V> ) rm.writePage( btree, node, 1 );
+                PersistedPageHolder<K, V> pageHolder = (PersistedPageHolder<K, V> ) rm.writePage( btree, node, 1 );
 
                 node = createNode( btree, 0, numKeysInNode );
                 lstNodes.add( node );
@@ -211,7 +205,7 @@ public class PersistedBTreeBuilder<K, V>
                 lastNode.setKeys( ( KeyHolder[] ) Array.newInstance( KeyHolder.class, n ) );
                 System.arraycopy( keys, 0, lastNode.getKeys(), 0, n );
 
-                PersistedPageHolder<K, V> pageHolder = ( PersistedPageHolder<K, V> ) rm.writePage( btree, lastNode, 1 );
+                PersistedPageHolder<K, V> pageHolder = (PersistedPageHolder<K, V> ) rm.writePage( btree, lastNode, 1 );
 
                 break;
             }

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeFactory.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeFactory.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeFactory.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeFactory.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeFactory.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeFactory.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedBTreeFactory.java Mon Dec 16 19:18:36 2013
@@ -17,18 +17,13 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.util.LinkedList;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.ParentPos;
-import org.apache.directory.mavibot.btree.ValueHolder;
+import org.apache.directory.mavibot.btree.persisted.BTreeConfiguration;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 
@@ -40,7 +35,7 @@ import org.apache.directory.mavibot.btre
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BTreeFactory
+public class PersistedBTreeFactory
 {
     /**
      * Create a new BTree.
@@ -292,13 +287,13 @@ public class BTreeFactory
 
         if ( btree.getRootPage() instanceof PersistedLeaf )
         {
-            PersistedLeaf<K, V> leaf = ( PersistedLeaf<K, V> ) ( btree.getRootPage() );
+            PersistedLeaf<K, V> leaf = (PersistedLeaf<K, V> ) ( btree.getRootPage() );
             ValueHolder<V> valueHolder = leaf.values[last.pos];
             last.valueCursor = valueHolder.getCursor();
         }
         else
         {
-            PersistedNode<K, V> node = ( PersistedNode<K, V> ) btree.getRootPage();
+            PersistedNode<K, V> node = (PersistedNode<K, V> ) btree.getRootPage();
 
             while ( true )
             {
@@ -309,7 +304,7 @@ public class BTreeFactory
 
                 if ( p instanceof PersistedLeaf )
                 {
-                    PersistedLeaf<K, V> leaf = ( PersistedLeaf<K, V> ) ( last.page );
+                    PersistedLeaf<K, V> leaf = (PersistedLeaf<K, V> ) ( last.page );
                     ValueHolder<V> valueHolder = leaf.values[last.pos];
                     last.valueCursor = valueHolder.getCursor();
                     break;
@@ -337,13 +332,13 @@ public class BTreeFactory
 
         if ( btree.getRootPage() instanceof PersistedLeaf )
         {
-            PersistedLeaf<K, V> leaf = ( PersistedLeaf<K, V> ) ( btree.getRootPage() );
+            PersistedLeaf<K, V> leaf = (PersistedLeaf<K, V> ) ( btree.getRootPage() );
             ValueHolder<V> valueHolder = leaf.values[first.pos];
             first.valueCursor = valueHolder.getCursor();
         }
         else
         {
-            PersistedNode<K, V> node = ( PersistedNode<K, V> ) btree.getRootPage();
+            PersistedNode<K, V> node = (PersistedNode<K, V> ) btree.getRootPage();
 
             while ( true )
             {
@@ -354,7 +349,7 @@ public class BTreeFactory
 
                 if ( page instanceof PersistedLeaf )
                 {
-                    PersistedLeaf<K, V> leaf = ( PersistedLeaf<K, V> ) ( page );
+                    PersistedLeaf<K, V> leaf = (PersistedLeaf<K, V> ) ( page );
                     ValueHolder<V> valueHolder = leaf.values[first.pos];
                     first.valueCursor = valueHolder.getCursor();
                     break;

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedKeyHolder.java (from r1551070, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedKeyHolder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedKeyHolder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedKeyHolder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedKeyHolder.java&r1=1551070&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedKeyHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedKeyHolder.java Mon Dec 16 19:18:36 2013
@@ -17,12 +17,11 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 
-import org.apache.directory.mavibot.btree.KeyHolder;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedLeaf.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedLeaf.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedLeaf.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java Mon Dec 16 19:18:36 2013
@@ -17,31 +17,12 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.lang.reflect.Array;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.MergedWithSiblingResult;
-import org.apache.directory.mavibot.btree.TupleCursor;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
-import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.ParentPos;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Transaction;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.ValueCursor;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 
@@ -222,8 +203,8 @@ import org.apache.directory.mavibot.btre
                 // if it has more than N/2 elements, or to merge the two pages.
                 // Check in both next and previous page, if they have the same parent
                 // and select the biggest page with the same parent to borrow an element.
-                int siblingPos = selectSibling( ( PersistedNode<K, V> ) parent, parentPos );
-                PersistedLeaf<K, V> sibling = ( PersistedLeaf<K, V> ) ( ( ( PersistedNode<K, V> ) parent ).getPage( siblingPos ) );
+                int siblingPos = selectSibling( (PersistedNode<K, V> ) parent, parentPos );
+                PersistedLeaf<K, V> sibling = (PersistedLeaf<K, V> ) ( ( (PersistedNode<K, V> ) parent ).getPage( siblingPos ) );
 
                 if ( sibling.getNbElems() == halfSize )
                 {
@@ -372,7 +353,7 @@ import org.apache.directory.mavibot.btre
         ValueHolder<V> siblingValue = sibling.values[sibling.getNbElems() - 1];
 
         // Create the new sibling, with one less element at the end
-        PersistedLeaf<K, V> newSibling = ( PersistedLeaf<K, V> ) sibling.copy( revision, sibling.getNbElems() - 1 );
+        PersistedLeaf<K, V> newSibling = (PersistedLeaf<K, V> ) sibling.copy( revision, sibling.getNbElems() - 1 );
 
         // Create the new page and add the new element at the beginning
         // First copy the current page, with the same size
@@ -802,7 +783,7 @@ import org.apache.directory.mavibot.btre
         if ( this.revision != revision )
         {
             // The page hasn't been modified yet, we need to copy it first
-            newLeaf = ( PersistedLeaf<K, V> ) copy( revision, nbElems );
+            newLeaf = (PersistedLeaf<K, V> ) copy( revision, nbElems );
         }
 
         // Get the previous value from the leaf (it's a copy)

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java (from r1551294, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedNode.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedNode.java&r1=1551294&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedNode.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedNode.java Mon Dec 16 19:18:36 2013
@@ -17,29 +17,13 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.List;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.BorrowedFromSiblingResult;
-import org.apache.directory.mavibot.btree.BorrowedFromLeftResult;
-import org.apache.directory.mavibot.btree.BorrowedFromRightResult;
-import org.apache.directory.mavibot.btree.DeleteResult;
-import org.apache.directory.mavibot.btree.InsertResult;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.MergedWithSiblingResult;
-import org.apache.directory.mavibot.btree.ModifyResult;
-import org.apache.directory.mavibot.btree.NotPresentResult;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.RemoveResult;
-import org.apache.directory.mavibot.btree.SplitResult;
-import org.apache.directory.mavibot.btree.Tuple;
-
 
 /**
  * A MVCC Node. It stores the keys and references to its children page. It does not
@@ -67,7 +51,7 @@ import org.apache.directory.mavibot.btre
         super( btree, revision, nbElems );
 
         // Create the children array
-        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class, nbElems + 1 );
+        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class, nbElems + 1 );
     }
 
 
@@ -88,7 +72,7 @@ import org.apache.directory.mavibot.btre
         super( btree, revision, 1 );
 
         // Create the children array, and store the left and right children
-        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
+        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
             btree.getPageSize() + 1 );
 
         children[0] = new PersistedPageHolder<K, V>( btree, leftPage );
@@ -121,7 +105,7 @@ import org.apache.directory.mavibot.btre
         super( btree, revision, 1 );
 
         // Create the children array, and store the left and right children
-        children = ( PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
+        children = (PersistedPageHolder<K, V>[] ) Array.newInstance( PersistedPageHolder.class,
             btree.getPageSize() + 1 );
 
         children[0] = leftPage;
@@ -660,9 +644,9 @@ import org.apache.directory.mavibot.btre
                 // We will remove one element from a page that will have less than N/2 elements,
                 // which will lead to some reorganization : either we can borrow an element from
                 // a sibling, or we will have to merge two pages
-                int siblingPos = selectSibling( ( PersistedNode<K, V> ) parent, parentPos );
+                int siblingPos = selectSibling( (PersistedNode<K, V> ) parent, parentPos );
 
-                PersistedNode<K, V> sibling = ( PersistedNode<K, V> ) ( ( ( PersistedNode<K, V> ) parent ).children[siblingPos].getValue() );
+                PersistedNode<K, V> sibling = (PersistedNode<K, V> ) ( ( (PersistedNode<K, V> ) parent ).children[siblingPos].getValue() );
 
                 if ( sibling.getNbElems() > halfSize )
                 {
@@ -884,7 +868,7 @@ import org.apache.directory.mavibot.btre
         // to point on the modified child
         Page<K, V> modifiedPage = result.getModifiedPage();
 
-        ( ( PersistedNode<K, V> ) newPage ).children[pos] = createHolder( modifiedPage );
+        (( PersistedNode<K, V> ) newPage ).children[pos] = createHolder( modifiedPage );
 
         // We can return the result, where we update the modifiedPage,
         // to avoid the creation of a new object

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java (from r1551187, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedPageHolder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedPageHolder.java&r1=1551187&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedPageHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedPageHolder.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
@@ -25,10 +25,6 @@ import java.io.IOException;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Element;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.PageHolder;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 
 

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java (from r1551187, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedValueHolder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedValueHolder.java&r1=1551187&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/PersistedValueHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedValueHolder.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.IOException;
@@ -25,13 +25,8 @@ import java.lang.reflect.Array;
 import java.util.Comparator;
 import java.util.UUID;
 
-import org.apache.directory.mavibot.btree.AbstractValueHolder;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.Tuple;
-import org.apache.directory.mavibot.btree.TupleCursor;
-import org.apache.directory.mavibot.btree.ValueCursor;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
+import org.apache.directory.mavibot.btree.persisted.BTreeConfiguration;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 
@@ -254,7 +249,7 @@ public class PersistedValueHolder<V> ext
             configuration.setParentBTree( parentBtree );
             configuration.setSubBtree( true );
             
-            valueBtree = BTreeFactory.createBTree( configuration );
+            valueBtree = PersistedBTreeFactory.createBTree( configuration );
 
             try
             {
@@ -599,7 +594,7 @@ public class PersistedValueHolder<V> ext
      */
     public ValueHolder<V> clone() throws CloneNotSupportedException
     {
-        PersistedValueHolder<V> copy = ( PersistedValueHolder<V> ) super.clone();
+        PersistedValueHolder<V> copy = (PersistedValueHolder<V> ) super.clone();
 
         // copy the valueArray if it's not null
         // We don't clone the BTree, as we will create new revisions when 

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java (from r1551280, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/RecordManager.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/RecordManager.java&r1=1551280&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/RecordManager.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/RecordManager.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.persisted;
+package org.apache.directory.mavibot.btree;
 
 
 import java.io.File;
@@ -33,14 +33,12 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.directory.mavibot.btree.AbstractPage;
-import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.KeyHolder;
-import org.apache.directory.mavibot.btree.Page;
-import org.apache.directory.mavibot.btree.ValueHolder;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
+import org.apache.directory.mavibot.btree.persisted.BTreeConfiguration;
+import org.apache.directory.mavibot.btree.persisted.RevisionName;
+import org.apache.directory.mavibot.btree.persisted.RevisionNameSerializer;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.apache.directory.mavibot.btree.serializer.LongArraySerializer;
@@ -370,7 +368,7 @@ public class RecordManager
             PageIO[] pageIos = readPageIOs( HEADER_SIZE, Long.MAX_VALUE );
 
             // Create the BTree
-            copiedPageBTree = BTreeFactory.<RevisionName, long[]> createBTree();
+            copiedPageBTree = PersistedBTreeFactory.<RevisionName, long[]> createBTree();
             ((PersistedBTree<RevisionName, long[]>)copiedPageBTree).setBtreeOffset( btreeOffset );
 
             loadBTree( pageIos, copiedPageBTree );
@@ -379,7 +377,7 @@ public class RecordManager
             // And the Revision BTree
             pageIos = readPageIOs( nextBtreeOffset, Long.MAX_VALUE );
 
-            revisionBTree = BTreeFactory.<RevisionName, Long> createBTree();
+            revisionBTree = PersistedBTreeFactory.<RevisionName, Long> createBTree();
             ((PersistedBTree<RevisionName, Long>)revisionBTree).setBtreeOffset( nextBtreeOffset );
 
             loadBTree( pageIos, revisionBTree );
@@ -389,7 +387,7 @@ public class RecordManager
             for ( int i = 2; i < nbBtree; i++ )
             {
                 // Create the BTree
-                BTree<Object, Object> btree = BTreeFactory.createBTree();
+                BTree<Object, Object> btree = PersistedBTreeFactory.createBTree();
                 ((PersistedBTree<Object, Object>)btree).setRecordManager( this );
                 ((PersistedBTree<Object, Object>)btree).setBtreeOffset( nextBtreeOffset );
                 lastAddedBTreeOffset = nextBtreeOffset;
@@ -477,34 +475,34 @@ public class RecordManager
 
         // The BTree current revision
         long revision = readLong( pageIos, dataPos );
-        BTreeFactory.setRevision( btree, revision );
+        PersistedBTreeFactory.setRevision( btree, revision );
         dataPos += LONG_SIZE;
 
         // The nb elems in the tree
         long nbElems = readLong( pageIos, dataPos );
-        BTreeFactory.setNbElems( btree, nbElems );
+        PersistedBTreeFactory.setNbElems( btree, nbElems );
         dataPos += LONG_SIZE;
 
         // The BTree rootPage offset
         long rootPageOffset = readLong( pageIos, dataPos );
-        BTreeFactory.setRootPageOffset( btree, rootPageOffset );
+        PersistedBTreeFactory.setRootPageOffset( btree, rootPageOffset );
         dataPos += LONG_SIZE;
 
         // The next BTree offset
         long nextBTreeOffset = readLong( pageIos, dataPos );
-        BTreeFactory.setNextBTreeOffset( btree, nextBTreeOffset );
+        PersistedBTreeFactory.setNextBTreeOffset( btree, nextBTreeOffset );
         dataPos += LONG_SIZE;
 
         // The BTree page size
         int btreePageSize = readInt( pageIos, dataPos );
-        BTreeFactory.setPageSize( btree, btreePageSize );
+        PersistedBTreeFactory.setPageSize( btree, btreePageSize );
         dataPos += INT_SIZE;
 
         // The tree name
         ByteBuffer btreeNameBytes = readBytes( pageIos, dataPos );
         dataPos += INT_SIZE + btreeNameBytes.limit();
         String btreeName = Strings.utf8ToString( btreeNameBytes );
-        BTreeFactory.setName( btree, btreeName );
+        PersistedBTreeFactory.setName( btree, btreeName );
 
         // The keySerializer FQCN
         ByteBuffer keySerializerBytes = readBytes( pageIos, dataPos );
@@ -517,7 +515,7 @@ public class RecordManager
             keySerializerFqcn = Strings.utf8ToString( keySerializerBytes );
         }
 
-        BTreeFactory.setKeySerializer( btree, keySerializerFqcn );
+        PersistedBTreeFactory.setKeySerializer( btree, keySerializerFqcn );
 
         // The valueSerialier FQCN
         ByteBuffer valueSerializerBytes = readBytes( pageIos, dataPos );
@@ -530,7 +528,7 @@ public class RecordManager
             valueSerializerFqcn = Strings.utf8ToString( valueSerializerBytes );
         }
 
-        BTreeFactory.setValueSerializer( btree, valueSerializerFqcn );
+        PersistedBTreeFactory.setValueSerializer( btree, valueSerializerFqcn );
 
         // The BTree allowDuplicates flag
         int allowDuplicates = readInt( pageIos, dataPos );
@@ -550,15 +548,15 @@ public class RecordManager
         PageIO[] rootPageIos = readPageIOs( rootPageOffset, Long.MAX_VALUE );
 
         Page<K, V> btreeRoot = readPage( btree, rootPageIos );
-        BTreeFactory.setRecordManager( btree, this );
+        PersistedBTreeFactory.setRecordManager( btree, this );
 
-        BTreeFactory.setRootPage( btree, btreeRoot );
+        PersistedBTreeFactory.setRootPage( btree, btreeRoot );
     }
 
 
     private <K, V> Page<K, V> readNode( BTree<K, V> btree, long offset, long revision, int nbElems ) throws IOException
     {
-        Page<K, V> node = BTreeFactory.createNode( btree, revision, nbElems );
+        Page<K, V> node = PersistedBTreeFactory.createNode( btree, revision, nbElems );
 
         // Read the rootPage pages on disk
         PageIO[] pageIos = readPageIOs( offset, Long.MAX_VALUE );
@@ -627,7 +625,7 @@ public class RecordManager
         PageIO[] pageIos )
     {
         // Its a leaf, create it
-        PersistedLeaf<K, V> leaf = BTreeFactory.createLeaf( btree, revision, nbElems );
+        PersistedLeaf<K, V> leaf = PersistedBTreeFactory.createLeaf( btree, revision, nbElems );
 
         // Store the page offset on disk
         leaf.setOffset( pageIos[0].getOffset() );
@@ -665,12 +663,12 @@ public class RecordManager
                 valueHolder = new PersistedValueHolder<V>( btree, nbValues, arrayBytes );
             }
 
-            BTreeFactory.setValue( leaf, i, valueHolder );
+            PersistedBTreeFactory.setValue( leaf, i, valueHolder );
 
             keyLengths[i] = byteBuffer.getInt();
             byte[] data = new byte[keyLengths[i]];
             byteBuffer.get( data );
-            BTreeFactory.setKey( btree, leaf, i, data );
+            PersistedBTreeFactory.setKey( btree, leaf, i, data );
         }
 
         return leaf;
@@ -683,7 +681,7 @@ public class RecordManager
     private <K, V> PersistedNode<K, V> readNodeKeysAndValues( BTree<K, V> btree, int nbElems, long revision, ByteBuffer byteBuffer,
         PageIO[] pageIos ) throws IOException
     {
-        PersistedNode<K, V> node = BTreeFactory.createNode( btree, revision, nbElems );
+        PersistedNode<K, V> node = PersistedBTreeFactory.createNode( btree, revision, nbElems );
 
         // Read each value and key
         for ( int i = 0; i < nbElems; i++ )
@@ -706,7 +704,7 @@ public class RecordManager
             // Set the new position now
             byteBuffer.position( currentPosition + keyLength );
             
-            BTreeFactory.setKey( btree, node, i, key );
+            PersistedBTreeFactory.setKey( btree, node, i, key );
         }
 
         // and read the last value, as it's a node
@@ -1003,7 +1001,7 @@ public class RecordManager
         IOException
     {
         LOG.debug( "Managing the btree {} which is an internam tree : {}", btree.getName(), internalTree );
-        BTreeFactory.setRecordManager( btree, this );
+        PersistedBTreeFactory.setRecordManager( btree, this );
 
         String name = btree.getName();
 
@@ -1067,7 +1065,7 @@ public class RecordManager
         position = store( position, btree.getNbElems(), pageIos );
 
         // Serialize the BTree root page
-        Page<K, V> rootPage = BTreeFactory.getRoot( btree );
+        Page<K, V> rootPage = PersistedBTreeFactory.getRoot( btree );
 
         PageIO[] rootPageIos = serializePage( btree, btree.getRevision(), rootPage );
 
@@ -1077,7 +1075,7 @@ public class RecordManager
         // Now, we can inject the BTree rootPage offset into the BTree header
         position = store( position, rootPageIo.getOffset(), pageIos );
         ((PersistedBTree<K, V>)btree).setRootPageOffset( rootPageIo.getOffset() );
-        ( ( PersistedLeaf<K, V> ) rootPage ).setOffset( rootPageIo.getOffset() );
+        ((PersistedLeaf<K, V>)rootPage ).setOffset( rootPageIo.getOffset() );
 
         // The next BTree Header offset (-1L, as it's a new BTree)
         position = store( position, NO_PAGE, pageIos );
@@ -1201,20 +1199,20 @@ public class RecordManager
                 // Start with the value
                 if ( page instanceof PersistedNode )
                 {
-                    dataSize += serializeNodeValue( ( PersistedNode<K, V> ) page, pos, serializedData );
-                    dataSize += serializeNodeKey( ( PersistedNode<K, V> ) page, pos, serializedData );
+                    dataSize += serializeNodeValue( (PersistedNode<K, V> ) page, pos, serializedData );
+                    dataSize += serializeNodeKey( (PersistedNode<K, V> ) page, pos, serializedData );
                 }
                 else
                 {
-                    dataSize += serializeLeafValue( ( PersistedLeaf<K, V> ) page, pos, serializedData );
-                    dataSize += serializeLeafKey( ( PersistedLeaf<K, V> ) page, pos, serializedData );
+                    dataSize += serializeLeafValue( (PersistedLeaf<K, V> ) page, pos, serializedData );
+                    dataSize += serializeLeafKey( (PersistedLeaf<K, V> ) page, pos, serializedData );
                 }
             }
 
             // Nodes have one more value to serialize
             if ( page instanceof PersistedNode )
             {
-                dataSize += serializeNodeValue( ( PersistedNode<K, V> ) page, nbElems, serializedData );
+                dataSize += serializeNodeValue( (PersistedNode<K, V> ) page, nbElems, serializedData );
             }
 
             // Store the data size
@@ -3014,7 +3012,7 @@ public class RecordManager
         {
             PageIO[] pageIos = readPageIOs( offset, Long.MAX_VALUE );
 
-            BTree<K, V> subBtree = BTreeFactory.createBTree();
+            BTree<K, V> subBtree = PersistedBTreeFactory.createBTree();
             ((PersistedBTree<K, V>)subBtree).setBtreeOffset( offset );
 
             loadBTree( pageIos, subBtree );

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BulkDataSorter.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BulkDataSorter.java?rev=1551319&r1=1551318&r2=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BulkDataSorter.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BulkDataSorter.java Mon Dec 16 19:18:36 2013
@@ -34,6 +34,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.UUID;
 
+import org.apache.directory.mavibot.btree.InMemoryBTreeBuilder;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.util.TupleReaderWriter;
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeConfiguration.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeConfiguration.java?rev=1551319&r1=1551318&r2=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeConfiguration.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BTreeConfiguration.java Mon Dec 16 19:18:36 2013
@@ -21,6 +21,7 @@ package org.apache.directory.mavibot.btr
 
 
 import org.apache.directory.mavibot.btree.BTree;
+import org.apache.directory.mavibot.btree.PersistedBTree;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 
 

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BulkDataSorter.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BulkDataSorter.java?rev=1551319&r1=1551318&r2=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BulkDataSorter.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/persisted/BulkDataSorter.java Mon Dec 16 19:18:36 2013
@@ -34,6 +34,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.UUID;
 
+import org.apache.directory.mavibot.btree.PersistedBTreeBuilder;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.util.TupleReaderWriter;
 

Copied: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfigurationTest.java (from r1551070, directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeConfigurationTest.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfigurationTest.java?p2=directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfigurationTest.java&p1=directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeConfigurationTest.java&r1=1551070&r2=1551319&rev=1551319&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeConfigurationTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeConfigurationTest.java Mon Dec 16 19:18:36 2013
@@ -17,7 +17,7 @@
  *  under the License.
  *
  */
-package org.apache.directory.mavibot.btree.memory;
+package org.apache.directory.mavibot.btree;
 
 
 import static org.junit.Assert.assertNotNull;
@@ -26,6 +26,7 @@ import java.io.File;
 import java.io.IOException;
 
 import org.apache.directory.mavibot.btree.BTree;
+import org.apache.directory.mavibot.btree.InMemoryBTree;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
@@ -39,7 +40,7 @@ import org.junit.rules.TemporaryFolder;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BTreeConfigurationTest
+public class InMemoryBTreeConfigurationTest
 {
     @Rule
     public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -119,7 +120,7 @@ public class BTreeConfigurationTest
     @Test
     public void testConfigurationBasic() throws IOException, KeyNotFoundException
     {
-        BTreeConfiguration<Integer, String> config = new BTreeConfiguration<Integer, String>();
+        InMemoryBTreeConfiguration<Integer, String> config = new InMemoryBTreeConfiguration<Integer, String>();
         config.setName( "basic" );
         config.setPageSize( 32 );
         config.setSerializers( new IntSerializer(), new StringSerializer() );
@@ -181,7 +182,7 @@ public class BTreeConfigurationTest
 
         try
         {
-            BTreeConfiguration<Integer, String> config = new BTreeConfiguration<Integer, String>();
+            InMemoryBTreeConfiguration<Integer, String> config = new InMemoryBTreeConfiguration<Integer, String>();
             config.setPageSize( 32 );
             config.setSerializers( new IntSerializer(), new StringSerializer() );
 



Mime
View raw message