directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551837 [2/2] - in /directory/mavibot/trunk/mavibot/src: main/java/org/apache/directory/mavibot/btree/ test/java/org/apache/directory/mavibot/btree/
Date Wed, 18 Dec 2013 04:42:26 GMT
Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeFlushTest.java
Wed Dec 18 04:42:25 2013
@@ -132,7 +132,7 @@ public class InMemoryBTreeFlushTest
         long delta = l1;
         int nbElems = 100000;
 
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -223,7 +223,7 @@ public class InMemoryBTreeFlushTest
         // Create a BTree with pages containing 8 elements
         String path = tempFolder.getRoot().getCanonicalPath();
 
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
path, new IntSerializer(),
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", path,
new IntSerializer(),
             new StringSerializer() );
         btree.setPageSize( 8 );
 
@@ -250,7 +250,7 @@ public class InMemoryBTreeFlushTest
             assertEquals( 0, journal.length() );
 
             // Load the data into a new tree
-            BTree<Integer, String> btreeLoaded = new InMemoryBTree<Integer, String>(
"test", path, new IntSerializer(),
+            BTree<Integer, String> btreeLoaded = BTreeFactory.createInMemoryBTree(
"test", path, new IntSerializer(),
                 new StringSerializer() );
             btree.setPageSize( 8 );
 
@@ -290,7 +290,7 @@ public class InMemoryBTreeFlushTest
     {
         String data100K = create100KElementsFile();
         File dataFile = new File( data100K );
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>(
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree(
             "test",
             dataFile.getParent(),
             new LongSerializer(),

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTest.java
Wed Dec 18 04:42:25 2013
@@ -177,7 +177,7 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new
LongSerializer(), new StringSerializer() );
             btree.setPageSize( 32 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -279,7 +279,7 @@ public class InMemoryBTreeTest
 
         for ( int j = 0; j < nbTrees; j++ )
         {
-            BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+            BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new
LongSerializer(), new StringSerializer() );
             btree.setPageSize( 8 );
 
             for ( int i = 0; i < nbElems; i++ )
@@ -394,7 +394,7 @@ public class InMemoryBTreeTest
                 368, 245, 1005, 226, 939, 320, 396, 437, 373, 61
         };
 
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
new StringSerializer() );
         btree.setPageSize( 8 );
 
         for ( long value : values )
@@ -453,7 +453,7 @@ public class InMemoryBTreeTest
 
         Random random = new Random( System.nanoTime() );
 
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Insert some values
@@ -513,7 +513,7 @@ public class InMemoryBTreeTest
     @Ignore("This is a debug test")
     public void testPageInsertDebug() throws Exception
     {
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
new StringSerializer() );
         btree.setPageSize( 4 );
 
         Long[] elems = new Long[]
@@ -573,7 +573,7 @@ public class InMemoryBTreeTest
     {
         Long[] keys = new Long[]{  101L, 113L, 20L, 72L, 215L, 239L, 108L, 21L };
         
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( new LongComparator(),
8 );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( new LongComparator(),
8 );
         System.out.println( btree );
 
         for ( Long key : keys )
@@ -619,7 +619,7 @@ public class InMemoryBTreeTest
     public void testBrowseForward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -703,7 +703,7 @@ public class InMemoryBTreeTest
     public void testBrowseBackward() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         // Inject the values
@@ -778,7 +778,7 @@ public class InMemoryBTreeTest
     public void testBrowseEmptyTree() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
 
         TupleCursor<Integer, String> cursor = btree.browse();
@@ -798,7 +798,7 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackward() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 0; i < 16; i++ )
@@ -1026,7 +1026,7 @@ public class InMemoryBTreeTest
     public void testBrowseNonExistingKey() throws Exception
     {
         // Create a BTree with pages containing 8 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 8 );
         for ( int i = 0; i < 11; i++ )
         {
@@ -1089,7 +1089,7 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1111,7 +1111,7 @@ public class InMemoryBTreeTest
      */
     private BTree<Integer, String> createTwoLevelBTreeHalfFullLeaves() throws IOException
     {
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         // Create a tree with 5 children containing 4 elements each. The tree is full.
@@ -1142,7 +1142,7 @@ public class InMemoryBTreeTest
         // Create a BTree with pages containing 4 elements
         int pageSize = 4;
 
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer(),
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer(),
             pageSize );
 
         InMemoryNode<Integer, String> root = new InMemoryNode<Integer, String>(
btree, 1L, pageSize );
@@ -1761,7 +1761,7 @@ public class InMemoryBTreeTest
         long delta = System.currentTimeMillis();
 
         // Create a BTree with 5 million entries
-        BTree<Long, String> btree = new InMemoryBTree<Long, String>( "test",
new LongSerializer(), new StringSerializer() );
+        BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(),
new StringSerializer() );
         btree.setPageSize( 32 );
 
         for ( int i = 0; i < nbElems; i++ )
@@ -1863,7 +1863,7 @@ public class InMemoryBTreeTest
     public void testBrowseForwardBackwardExtremes() throws Exception
     {
         // Create a BTree with pages containing 4 elements
-        BTree<Integer, String> btree = new InMemoryBTree<Integer, String>( "test",
new IntSerializer(), new StringSerializer() );
+        BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", new
IntSerializer(), new StringSerializer() );
         btree.setPageSize( 4 );
 
         for ( int i = 8; i < 13; i++ )
@@ -1959,7 +1959,7 @@ public class InMemoryBTreeTest
     public void testCheckRootPageContents() throws Exception
     {
         IntSerializer ser = new IntSerializer();
-        BTree<Integer, Integer> btree = new InMemoryBTree<Integer,Integer>( "master1",
ser, ser );
+        BTree<Integer, Integer> btree = BTreeFactory.createInMemoryBTree( "master1",
ser, ser );
         btree.setPageSize( 4 );
         btree.init();
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeTestOps.java
Wed Dec 18 04:42:25 2013
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.util.Random;
 
 import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.InMemoryBTree;
 import org.apache.directory.mavibot.btree.serializer.LongSerializer;
 import org.apache.directory.mavibot.btree.serializer.StringSerializer;
 import org.junit.AfterClass;
@@ -50,7 +49,7 @@ public class InMemoryBTreeTestOps
     @BeforeClass
     public static void setup() throws IOException
     {
-        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new
StringSerializer() );
+        btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer()
);
     }
 
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryLeafTest.java
Wed Dec 18 04:42:25 2013
@@ -30,7 +30,6 @@ import org.apache.directory.mavibot.btre
 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.InMemoryBTree;
 import org.apache.directory.mavibot.btree.InsertResult;
 import org.apache.directory.mavibot.btree.KeyHolder;
 import org.apache.directory.mavibot.btree.MergedWithSiblingResult;
@@ -63,7 +62,7 @@ public class InMemoryLeafTest
     @Before
     public void setup() throws IOException
     {
-        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new
StringSerializer() );
+        btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer()
);
         btree.setPageSize( 8 );
     }
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/MultiThreadedInMemoryBtreeTest.java
Wed Dec 18 04:42:25 2013
@@ -28,7 +28,6 @@ import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 
 import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.InMemoryBTree;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
@@ -57,7 +56,7 @@ public class MultiThreadedInMemoryBtreeT
     @BeforeClass
     public static void setup() throws IOException
     {
-        btree = new InMemoryBTree<Long, String>( "test", new LongSerializer(), new
StringSerializer() );
+        btree = BTreeFactory.createInMemoryBTree( "test", new LongSerializer(), new StringSerializer()
);
     }
 
 

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeBuilderTest.java
Wed Dec 18 04:42:25 2013
@@ -27,7 +27,6 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.mavibot.btree.BTree;
 import org.apache.directory.mavibot.btree.PersistedBTreeBuilder;
 import org.apache.directory.mavibot.btree.RecordManager;

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/PersistedBTreeDuplicateKeyTest.java
Wed Dec 18 04:42:25 2013
@@ -34,7 +34,6 @@ import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.PersistedBTree;
 import org.apache.directory.mavibot.btree.RecordManager;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -147,7 +146,7 @@ public class PersistedBTreeDuplicateKeyT
     {
         IntSerializer serializer = new IntSerializer();
 
-        BTree<Integer, Integer> btree = new PersistedBTree<Integer, Integer>(
"master", serializer, serializer );
+        BTree<Integer, Integer> btree = BTreeFactory.createPersistedBTree( "master",
serializer, serializer );
         btree.init();
 
         TupleCursor<Integer, Integer> cursor = btree.browse();

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java?rev=1551837&r1=1551836&r2=1551837&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/RecordManagerTest.java
Wed Dec 18 04:42:25 2013
@@ -36,7 +36,6 @@ import java.util.UUID;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.mavibot.btree.BTree;
-import org.apache.directory.mavibot.btree.PersistedBTree;
 import org.apache.directory.mavibot.btree.RecordManager;
 import org.apache.directory.mavibot.btree.Tuple;
 import org.apache.directory.mavibot.btree.TupleCursor;
@@ -848,9 +847,8 @@ 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 PersistedBTree<Long, String>( name,
null, new LongSerializer(),
-            new StringSerializer(), pageSize,
-            true );
+        BTree<Long, String> dupsTree = BTreeFactory.createPersistedBTree( name, new
LongSerializer(),
+            new StringSerializer(), pageSize, true );
 
         recordManager1.manage( dupsTree );
         



Mime
View raw message