directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1550580 [3/3] - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ main/java/org/apache/directory/mavibot/btree/managed/ main/java/org/apache/directory/mavibot/btree/memory/ test/java/org/apache/director...
Date Thu, 12 Dec 2013 23:08:29 GMT
Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java (from r1550046, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeBuilder.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeBuilder.java&r1=1550046&r2=1550580&rev=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/BTreeBuilder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeBuilder.java Thu Dec 12 23:08:28 2013
@@ -32,6 +32,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
@@ -42,7 +43,7 @@ import org.apache.directory.mavibot.btre
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BTreeBuilder<K, V>
+public class InMemoryBTreeBuilder<K, V>
 {
     private String name;
 
@@ -53,7 +54,7 @@ public class BTreeBuilder<K, V>
     private ElementSerializer<V> valueSerializer;
 
 
-    public BTreeBuilder( String name, int numKeysInNode, ElementSerializer<K> keySerializer,
+    public InMemoryBTreeBuilder( String name, int numKeysInNode, ElementSerializer<K> keySerializer,
         ElementSerializer<V> valueSerializer )
     {
         this.name = name;
@@ -66,7 +67,7 @@ public class BTreeBuilder<K, V>
     @SuppressWarnings("unchecked")
     public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws IOException
     {
-        BTree<K, V> btree = new BTree<K, V>( name, keySerializer, valueSerializer );
+        BTree<K, V> btree = new InMemoryBTree<K, V>( name, keySerializer, valueSerializer );
         btree.init();
 
         List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>();
@@ -128,7 +129,7 @@ public class BTreeBuilder<K, V>
 
         System.out.println("built rootpage : " + rootPage);
         
-        btree.rootPage = rootPage;
+        btree.setRootPage( rootPage );
 
         return btree;
     }

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Leaf.java Thu Dec 12 23:08:28 2013
@@ -23,6 +23,7 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.lang.reflect.Array;
 
+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;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/Node.java Thu Dec 12 23:08:28 2013
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.List;
 
+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;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/TupleCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/TupleCursorImpl.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/TupleCursorImpl.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/TupleCursorImpl.java Thu Dec 12 23:08:28 2013
@@ -23,6 +23,7 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.util.NoSuchElementException;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.ParentPos;
 import org.apache.directory.mavibot.btree.Transaction;

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ValueHolder.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ValueHolder.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ValueHolder.java (original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/memory/ValueHolder.java Thu Dec 12 23:08:28 2013
@@ -24,9 +24,11 @@ import java.io.IOException;
 import java.util.Comparator;
 import java.util.UUID;
 
+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.ValueBTreeCursor;
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 
 
@@ -199,199 +201,6 @@ public class ValueHolder<V> implements C
 
     
     /**
-     * A class that encapsulate the values into an sub-btree
-     */
-    private class ValueBtreeCursor implements ValueCursor<V>
-    {
-        /** Store the current position in the array or in the BTree */
-        private TupleCursor<V, V> cursor;
-
-
-        /**
-         * Create an instance
-         */
-        private ValueBtreeCursor()
-        {
-            // Start at -1 to be positioned before the first element
-            try
-            {
-                if ( valueBtree != null )
-                {
-                    cursor = valueBtree.browse();
-                }
-            }
-            catch ( IOException e )
-            {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public boolean hasNext()
-        {
-            if ( cursor == null )
-            {
-                return false;
-            }
-            else
-            {
-                try
-                {
-                    return cursor.hasNext();
-                }
-                catch ( EndOfFileExceededException e )
-                {
-                    e.printStackTrace();
-                    return false;
-                }
-                catch ( IOException e )
-                {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        public V next()
-        {
-            try
-            {
-                return cursor.next().getKey();
-            }
-            catch ( EndOfFileExceededException e )
-            {
-                e.printStackTrace();
-                return null;
-            }
-            catch ( IOException e )
-            {
-                e.printStackTrace();
-                return null;
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public boolean hasPrev() throws EndOfFileExceededException, IOException
-        {
-            if ( cursor == null )
-            {
-                return false;
-            }
-            else
-            {
-                try
-                {
-                    return cursor.hasPrev();
-                }
-                catch ( EndOfFileExceededException e )
-                {
-                    e.printStackTrace();
-                    return false;
-                }
-                catch ( IOException e )
-                {
-                    e.printStackTrace();
-                    return false;
-                }
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public void close()
-        {
-            if ( cursor != null )
-            {
-                cursor.close();
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public void beforeFirst() throws IOException
-        {
-            if ( cursor != null )
-            {
-                cursor.beforeFirst();
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public void afterLast() throws IOException
-        {
-            if ( cursor != null )
-            {
-                cursor.afterLast();
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}}
-         */
-        @Override
-        public V prev() throws EndOfFileExceededException, IOException
-        {
-            try
-            {
-                return cursor.prev().getKey();
-            }
-            catch ( EndOfFileExceededException e )
-            {
-                e.printStackTrace();
-                return null;
-            }
-            catch ( IOException e )
-            {
-                e.printStackTrace();
-                return null;
-            }
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public int size()
-        {
-            return ( int ) valueBtree.getNbElems();
-        }
-
-
-        /**
-         * @see Object#toString()
-         */
-        public String toString()
-        {
-            return "BTreeCursor";
-        }
-    }
-
-    /**
      * Creates a new instance of a ValueHolder, containing the serialized values.
      * 
      * @param btree the container BTree
@@ -457,7 +266,7 @@ public class ValueHolder<V> implements C
 
         if ( valueBtree != null )
         {
-            cursor = new ValueBtreeCursor();
+            cursor = new ValueBTreeCursor<V>( valueBtree );
         }
         else
         {
@@ -504,7 +313,7 @@ public class ValueHolder<V> implements C
             configuration.setAllowDuplicates( false );
             configuration.setName( UUID.randomUUID().toString() );
             
-            valueBtree = new BTree<V, V>( configuration );
+            valueBtree = new InMemoryBTree<V, V>( configuration );
         }
         catch ( IOException e )
         {
@@ -531,7 +340,7 @@ public class ValueHolder<V> implements C
         // Ok, create a sub-btree
         try
         {
-            valueBtree = new BTree<V, V>( UUID.randomUUID().toString(), btree.getValueSerializer(),
+            valueBtree = new InMemoryBTree<V, V>( UUID.randomUUID().toString(), btree.getValueSerializer(),
                 btree.getValueSerializer() );
 
             valueBtree.insert( value, null, 0 );
@@ -556,7 +365,7 @@ public class ValueHolder<V> implements C
         {
             try
             {
-                valueBtree = new BTree<V, V>( UUID.randomUUID().toString(), btree.getValueSerializer(),
+                valueBtree = new InMemoryBTree<V, V>( UUID.randomUUID().toString(), btree.getValueSerializer(),
                     btree.getValueSerializer() );
 
                 valueBtree.insert( value, null, 0 );

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/BTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/BTreeDuplicateKeyTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/BTreeDuplicateKeyTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/BTreeDuplicateKeyTest.java Thu Dec 12 23:08:28 2013
@@ -32,6 +32,7 @@ import java.io.IOException;
 import java.util.NoSuchElementException;
 import java.util.UUID;
 
+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.serializer.IntSerializer;
@@ -128,7 +129,7 @@ public class BTreeDuplicateKeyTest
     {
         IntSerializer serializer = new IntSerializer();
 
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( "master", serializer, serializer );
+        BTree<Integer, Integer> btree = new PersistedBTree<Integer, Integer>( "master", serializer, serializer );
         btree.init();
 
         TupleCursor<Integer, Integer> cursor = btree.browse();

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBrowseTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBrowseTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBrowseTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBrowseTest.java Thu Dec 12 23:08:28 2013
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.util.NoSuchElementException;
 import java.util.UUID;
 
+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.exception.BTreeAlreadyManagedException;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBuilderTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBuilderTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/ManagedBTreeBuilderTest.java Thu Dec 12 23:08:28 2013
@@ -27,6 +27,7 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
+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.serializer.IntSerializer;
@@ -45,6 +46,7 @@ public class ManagedBTreeBuilderTest
     public void testManagedBTreeBuilding() throws Exception
     {
         List<Tuple<Integer, Integer>> sortedTuple = new ArrayList<Tuple<Integer, Integer>>();
+        
         for ( int i = 1; i < 8; i++ )
         {
             Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( i, i );
@@ -57,7 +59,7 @@ public class ManagedBTreeBuilderTest
         RecordManager rm = new RecordManager( file.getAbsolutePath() );
         
         IntSerializer ser = new IntSerializer();
-        ManagedBTreeBuilder<Integer, Integer> bb = new ManagedBTreeBuilder<Integer, Integer>( rm, "master", 4, ser, ser );
+        PersistedBTreeBuilder<Integer, Integer> bb = new PersistedBTreeBuilder<Integer, Integer>( rm, "master", 4, ser, ser );
 
         // contains 1, 2, 3, 4, 5, 6, 7
         BTree<Integer, Integer> btree = bb.build( sortedTuple.iterator() );
@@ -67,11 +69,11 @@ public class ManagedBTreeBuilderTest
         rm = new RecordManager( file.getAbsolutePath() );
         btree = rm.getManagedTree( "master" );
         
-        assertEquals( 1, btree.rootPage.getNbElems() );
+        assertEquals( 1, btree.getRootPage().getNbElems() );
 
-        assertEquals( 7, btree.rootPage.findRightMost().getKey().intValue() );
+        assertEquals( 7, btree.getRootPage().findRightMost().getKey().intValue() );
 
-        assertEquals( 1, btree.rootPage.findLeftMost().getKey().intValue() );
+        assertEquals( 1, btree.getRootPage().findLeftMost().getKey().intValue() );
 
         TupleCursor<Integer, Integer> cursor = btree.browse();
         int i = 0;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerFreePageTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerFreePageTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerFreePageTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerFreePageTest.java Thu Dec 12 23:08:28 2013
@@ -28,6 +28,7 @@ import java.io.IOException;
 import java.util.Set;
 
 import org.apache.commons.io.FileUtils;
+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.exception.BTreeAlreadyManagedException;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerPrivateMethodTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerPrivateMethodTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerPrivateMethodTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerPrivateMethodTest.java Thu Dec 12 23:08:28 2013
@@ -28,6 +28,7 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.util.UUID;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
 import org.junit.After;
@@ -44,7 +45,6 @@ import org.junit.rules.TemporaryFolder;
  */
 public class RecordManagerPrivateMethodTest
 {
-
     private BTree<Long, String> btree = null;
 
     private RecordManager recordManager = null;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerTest.java Thu Dec 12 23:08:28 2013
@@ -34,6 +34,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
+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;
@@ -239,6 +240,7 @@ public class RecordManagerTest
 
         // Now, add some elements in the BTree
         long t0 = System.currentTimeMillis();
+        
         for ( Long i = 0L; i < nbElems; i++ )
         {
             String value = "V" + i;
@@ -830,7 +832,7 @@ public class RecordManagerTest
         String name = "duplicateTree";
         String[] testValues = new String[]{ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0A", "0B", "0C", "0D", "0E", "0F", "10" };
 
-        BTree<Long, String> dupsTree = new BTree<Long, String>( name, null, new LongSerializer(),
+        BTree<Long, String> dupsTree = new PersistedBTree<Long, String>( name, null, new LongSerializer(),
             new StringSerializer(), pageSize,
             true );
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerWithDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerWithDuplicatesTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerWithDuplicatesTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/managed/RecordManagerWithDuplicatesTest.java Thu Dec 12 23:08:28 2013
@@ -29,6 +29,7 @@ import java.io.IOException;
 import java.util.Set;
 import java.util.UUID;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.exception.BTreeAlreadyManagedException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeBuilderTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeBuilderTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeBuilderTest.java Thu Dec 12 23:08:28 2013
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+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.serializer.IntSerializer;
@@ -51,16 +52,16 @@ public class BTreeBuilderTest
         }
 
         IntSerializer ser = new IntSerializer();
-        BTreeBuilder<Integer, Integer> bb = new BTreeBuilder<Integer, Integer>( "master", 4, ser, ser );
+        InMemoryBTreeBuilder<Integer, Integer> bb = new InMemoryBTreeBuilder<Integer, Integer>( "master", 4, ser, ser );
 
         // contains 1, 2, 3, 4, 5, 6, 7
         BTree<Integer, Integer> btree = bb.build( sortedTuple.iterator() );
 
-        assertEquals( 1, btree.rootPage.getNbElems() );
+        assertEquals( 1, btree.getRootPage().getNbElems() );
 
-        assertEquals( 7, btree.rootPage.findRightMost().getKey().intValue() );
+        assertEquals( 7, btree.getRootPage().findRightMost().getKey().intValue() );
 
-        assertEquals( 1, btree.rootPage.findLeftMost().getKey().intValue() );
+        assertEquals( 1, btree.getRootPage().findLeftMost().getKey().intValue() );
 
         TupleCursor<Integer, Integer> cursor = btree.browse();
         int i = 0;

Modified: 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/memory/BTreeConfigurationTest.java?rev=1550580&r1=1550579&r2=1550580&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/memory/BTreeConfigurationTest.java Thu Dec 12 23:08:28 2013
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertNot
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
@@ -126,7 +127,7 @@ public class BTreeConfigurationTest
         try
         {
             // Create the BTree
-            BTree<Integer, String> btree = new BTree<Integer, String>( config );
+            BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( config );
 
             // Inject the values
             for ( int value : sortedValues )
@@ -188,7 +189,7 @@ public class BTreeConfigurationTest
             config.setName( "mavibot" );
 
             // Create the BTree
-            BTree<Integer, String> btree = new BTree<Integer, String>( config );
+            BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( config );
 
             // Inject the values
             for ( int value : sortedValues )
@@ -210,7 +211,7 @@ public class BTreeConfigurationTest
             btree.close();
 
             // Now, create a new BTree using the same configuration
-            BTree<Integer, String> btreeCopy = new BTree<Integer, String>( config );
+            BTree<Integer, String> btreeCopy = new InMemoryBTree<Integer, String>( config );
 
             // Check that the tree contains all the values
             for ( int key : sortedValues )

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeDuplicateKeyTest.java Thu Dec 12 23:08:28 2013
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.util.NoSuchElementException;
 import java.util.UUID;
 
+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.serializer.IntSerializer;
@@ -50,7 +51,7 @@ public class BTreeDuplicateKeyTest
     {
         IntSerializer serializer = new IntSerializer();
 
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( "master", serializer, serializer );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( "master", serializer, serializer );
         btree.init();
 
         btree.insert( 1, null );
@@ -74,7 +75,7 @@ public class BTreeDuplicateKeyTest
     {
         IntSerializer serializer = new IntSerializer();
 
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( "master", serializer, serializer );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( "master", serializer, serializer );
         btree.init();
 
         TupleCursor<Integer, Integer> cursor = btree.browse();
@@ -115,7 +116,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         btree.insert( 1, 1 );
         btree.insert( 1, 2 );
@@ -171,7 +172,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         Integer retVal = btree.insert( 1, 1 );
         assertNull( retVal );
@@ -206,7 +207,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         btree.insert( 1, 1 );
         btree.insert( 1, 2 );
@@ -241,7 +242,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<String, String> btree = new BTree<String, String>( config );
+        BTree<String, String> btree = new InMemoryBTree<String, String>( config );
 
         int i = 7;
         for ( char ch = 'a'; ch <= 'z'; ch++ )
@@ -302,7 +303,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<String, String> btree = new BTree<String, String>( config );
+        BTree<String, String> btree = new InMemoryBTree<String, String>( config );
 
         for ( char ch = 'a'; ch <= 'z'; ch++ )
         {
@@ -390,7 +391,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<String, String> btree = new BTree<String, String>( config );
+        BTree<String, String> btree = new InMemoryBTree<String, String>( config );
 
         for ( char ch = 'a'; ch <= 'z'; ch++ )
         {
@@ -430,7 +431,7 @@ public class BTreeDuplicateKeyTest
         config.setAllowDuplicates( true );
         config.setName( "master" );
         config.setSerializers( serializer, serializer );
-        BTree<String, String> btree = new BTree<String, String>( config );
+        BTree<String, String> btree = new InMemoryBTree<String, String>( config );
 
         int i = 7;
         
@@ -537,7 +538,7 @@ public class BTreeDuplicateKeyTest
         config.setName( "master" );
         config.setPageSize( 4 );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         int i = 7;
         for ( int k = 0; k < i; k++ )
@@ -611,7 +612,7 @@ public class BTreeDuplicateKeyTest
         config.setName( "master" );
         config.setPageSize( 4 );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         int i = 7;
         for ( int k = 0; k < i; k++ )
@@ -657,7 +658,7 @@ public class BTreeDuplicateKeyTest
         config.setName( "master" );
         config.setPageSize( 8 );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         int i = 5;
         for ( int k = 0; k < i; k++ )
@@ -696,7 +697,7 @@ public class BTreeDuplicateKeyTest
         config.setName( "master" );
         config.setPageSize( 8 );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         int i = 5;
         

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/BTreeFlushTest.java Thu Dec 12 23:08:28 2013
@@ -29,6 +29,7 @@ import java.io.IOException;
 import java.util.Random;
 import java.util.Set;
 
+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.exception.KeyNotFoundException;
@@ -130,7 +131,7 @@ public class BTreeFlushTest
         long delta = l1;
         int nbElems = 100000;
 
-        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -177,7 +178,7 @@ public class BTreeFlushTest
 
         long t0 = System.currentTimeMillis();
 
-        btree.flush( tempFile );
+        ((InMemoryBTree<Long, String>)btree).flush( tempFile );
 
         long t1 = System.currentTimeMillis();
 
@@ -221,12 +222,12 @@ public class BTreeFlushTest
         // Create a BTree with pages containing 8 elements
         String path = tempFolder.getRoot().getCanonicalPath();
 
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", path, new IntSerializer(),
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", path, new IntSerializer(),
             new StringSerializer() );
         btree.setPageSize( 8 );
 
-        File journal = btree.getJournal();
-        File data = btree.getFile();
+        File journal = ((InMemoryBTree<Integer, String>)btree).getJournal();
+        File data = ((InMemoryBTree<Integer, String>)btree).getFile();
 
         try
         {
@@ -248,7 +249,7 @@ public class BTreeFlushTest
             assertEquals( 0, journal.length() );
 
             // Load the data into a new tree
-            BTree<Integer, String> btreeLoaded = new BTree<Integer, String>( "test", path, new IntSerializer(),
+            BTree<Integer, String> btreeLoaded = new InMemoryBTree<Integer, String>( "test", path, new IntSerializer(),
                 new StringSerializer() );
             btree.setPageSize( 8 );
 
@@ -288,7 +289,7 @@ public class BTreeFlushTest
     {
         String data100K = create100KElementsFile();
         File dataFile = new File( data100K );
-        BTree<Long, String> btree = new BTree<Long, String>(
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>(
             "test",
             dataFile.getParent(),
             new LongSerializer(),

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTest.java Thu Dec 12 23:08:28 2013
@@ -35,6 +35,7 @@ import java.util.List;
 import java.util.Random;
 import java.util.Set;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.Page;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -171,7 +172,7 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
             btree.setPageSize( 32 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -273,7 +274,7 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
             btree.setPageSize( 8 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -388,7 +389,7 @@ public class InMemoryBTreeTest
                 368, 245, 1005, 226, 939, 320, 396, 437, 373, 61
         };
 
-        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         for ( long value : values )
@@ -447,7 +448,7 @@ public class InMemoryBTreeTest
 
         Random random = new Random( System.nanoTime() );
 
-        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Insert some values
@@ -507,7 +508,7 @@ public class InMemoryBTreeTest
     @Ignore("This is a debug test")
     public void testPageInsertDebug() throws Exception
     {
-        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         Long[] elems = new Long[]
@@ -567,7 +568,7 @@ public class InMemoryBTreeTest
     {
         Long[] keys = new Long[]{  101L, 113L, 20L, 72L, 215L, 239L, 108L, 21L };
         
-        BTree<Long, String> btree = new BTree<Long, String>( new LongComparator(), 8 );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( new LongComparator(), 8 );
         System.out.println( btree );
 
         for ( Long key : keys )
@@ -613,7 +614,7 @@ public class InMemoryBTreeTest
     public void testBrowseForward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -697,7 +698,7 @@ public class InMemoryBTreeTest
     public void testBrowseBackward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -772,7 +773,7 @@ public class InMemoryBTreeTest
     public void testBrowseEmptyTree() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         TupleCursor<Integer, String> cursor = btree.browse();
@@ -792,7 +793,7 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackward() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 0; i < 16; i++ )
@@ -1018,7 +1019,7 @@ public class InMemoryBTreeTest
     public void testBrowseNonExistingKey() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
         for ( int i = 0; i < 11; i++ )
         {
@@ -1053,7 +1054,7 @@ public class InMemoryBTreeTest
         for ( Tuple<Integer, String> tuple : tuples )
         {
             leaf.keys[pos] = tuple.getKey();
-            leaf.values[pos] = btree.createValueHolder( tuple.getValue() );
+            leaf.values[pos] = new ValueHolder<String>( btree, tuple.getValue() );
             pos++;
         }
 
@@ -1080,7 +1081,7 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1102,7 +1103,7 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeHalfFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1133,7 +1134,7 @@ public class InMemoryBTreeTest
         // Create a BTree with pages containing 4 elements
         int pageSize = 4;
 
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer(),
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer(),
             pageSize );
 
         Node<Integer, String> root = new Node<Integer, String>( btree, 1L, pageSize );
@@ -1167,7 +1168,7 @@ public class InMemoryBTreeTest
             addPage( btree, root, node, i );
         }
 
-        btree.setRoot( root );
+        btree.setRootPage( root );
 
         return btree;
     }
@@ -1750,7 +1751,7 @@ public class InMemoryBTreeTest
         long delta = System.currentTimeMillis();
 
         // Create a BTree with 5 million entries
-        BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -1852,7 +1853,7 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackwardExtremes() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = new BTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test", new IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 8; i < 13; i++ )
@@ -1913,7 +1914,7 @@ public class InMemoryBTreeTest
         config.setName( "master" );
         config.setPageSize( 4 );
         config.setSerializers( serializer, serializer );
-        BTree<Integer, Integer> btree = new BTree<Integer, Integer>( config );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer, Integer>( config );
 
         int i = 7;
         for ( int k = 0; k < i; k++ )
@@ -1947,7 +1948,7 @@ public class InMemoryBTreeTest
     public void testCheckRootPageContents() throws Exception
     {
         IntSerializer ser = new IntSerializer();
-        BTree<Integer, Integer> btree = new BTree<Integer,Integer>( "master1", ser, ser );
+        BTree<Integer, Integer> btree = new InMemoryBTree<Integer,Integer>( "master1", ser, ser );
         btree.setPageSize( 4 );
         btree.init();
 
@@ -1956,14 +1957,13 @@ public class InMemoryBTreeTest
             btree.insert( i, i );
         }
 
-        System.out.println( btree.rootPage );
-        assertEquals( 2, btree.rootPage.getNbElems() );
+        System.out.println( btree.getRootPage() );
+        assertEquals( 2, btree.getRootPage().getNbElems() );
 
-        assertEquals( 7, btree.rootPage.findRightMost().getKey().intValue() );
+        assertEquals( 7, btree.getRootPage().findRightMost().getKey().intValue() );
 
-        assertEquals( 1, btree.rootPage.findLeftMost().getKey().intValue() );
+        assertEquals( 1, btree.getRootPage().findLeftMost().getKey().intValue() );
 
         btree.close();
     }
-
 }

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/InMemoryBTreeTestOps.java Thu Dec 12 23:08:28 2013
@@ -23,6 +23,7 @@ package org.apache.directory.mavibot.btr
 import java.io.IOException;
 import java.util.Random;
 
+import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
 import org.junit.AfterClass;
@@ -48,7 +49,7 @@ public class InMemoryBTreeTestOps
     @BeforeClass
     public static void setup() throws IOException
     {
-        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
     }
 
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/LeafTest.java Thu Dec 12 23:08:28 2013
@@ -26,6 +26,7 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
+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;
@@ -58,7 +59,7 @@ public class LeafTest
     @Before
     public void setup() throws IOException
     {
-        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
     }
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java?rev=1550580&r1=1550579&r2=1550580&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java (original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/memory/MultiThreadedBtreeTest.java Thu Dec 12 23:08:28 2013
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 
+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.exception.KeyNotFoundException;
@@ -55,7 +56,7 @@ public class MultiThreadedBtreeTest
     @BeforeClass
     public static void setup() throws IOException
     {
-        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
+        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
     }
 
 



Mime
View raw message