From: Bryan T. <tho...@us...> - 2007-03-27 14:34:58
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6186/src/test/com/bigdata/objndx Modified Files: TestIndexSegmentWithBloomFilter.java TestIndexSegmentBuilderWithLargeTrees.java TestIncrementalWrite.java TestReopen.java AbstractBTreeTestCase.java TestRestartSafe.java TestNodeSerializer.java TestTouch.java TestCommit.java Log Message: Added indexUUID to AbstractBTree so that each scale-out index may have a unique indentifier. Modified the BTreeMetadata class and derived classes to use Externalizable, to support explicit versioning of the metadata record, and to have private fields since they can not be final with Externalizable. Index: TestIndexSegmentBuilderWithLargeTrees.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentBuilderWithLargeTrees.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestIndexSegmentBuilderWithLargeTrees.java 22 Mar 2007 21:11:24 -0000 1.13 --- TestIndexSegmentBuilderWithLargeTrees.java 27 Mar 2007 14:34:21 -0000 1.14 *************** *** 51,54 **** --- 51,55 ---- import java.io.IOException; import java.util.Properties; + import java.util.UUID; import com.bigdata.journal.BufferMode; *************** *** 105,109 **** Journal journal = new Journal(getProperties()); ! BTree btree = new BTree(journal, branchingFactor, SimpleEntry.Serializer.INSTANCE); --- 106,110 ---- Journal journal = new Journal(getProperties()); ! BTree btree = new BTree(journal, branchingFactor, UUID.randomUUID(), SimpleEntry.Serializer.INSTANCE); Index: TestIndexSegmentWithBloomFilter.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentWithBloomFilter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TestIndexSegmentWithBloomFilter.java 22 Mar 2007 21:11:24 -0000 1.11 --- TestIndexSegmentWithBloomFilter.java 27 Mar 2007 14:34:21 -0000 1.12 *************** *** 53,58 **** import java.io.IOException; import java.util.Properties; - import com.bigdata.cache.HardReferenceQueue; import com.bigdata.journal.BufferMode; import com.bigdata.journal.Journal; --- 53,58 ---- import java.io.IOException; import java.util.Properties; + import java.util.UUID; import com.bigdata.journal.BufferMode; import com.bigdata.journal.Journal; *************** *** 139,152 **** Journal journal = new Journal(properties); ! // A modest leaf queue capacity. ! final int leafQueueCapacity = 500; ! ! final int nscan = 10; ! ! BTree btree = new BTree(journal, branchingFactor, ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! leafQueueCapacity, nscan), ! SimpleEntry.Serializer.INSTANCE, null // no record compressor ! ); return btree; --- 139,144 ---- Journal journal = new Journal(properties); ! BTree btree = new BTree(journal, branchingFactor, UUID.randomUUID(), ! SimpleEntry.Serializer.INSTANCE); return btree; Index: TestReopen.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestReopen.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestReopen.java 15 Mar 2007 16:11:09 -0000 1.1 --- TestReopen.java 27 Mar 2007 14:34:21 -0000 1.2 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.objndx; + import java.util.UUID; + import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; *************** *** 110,113 **** --- 112,117 ---- IRawStore store = new SimpleMemoryRawStore(); + final UUID indexUUID = UUID.randomUUID(); + /* * The btree under test. *************** *** 117,121 **** * by the default fixture factory). */ ! BTree btree = new BTree(store, 3, SimpleEntry.Serializer.INSTANCE); /* --- 121,125 ---- * by the default fixture factory). */ ! BTree btree = new BTree(store, 3, indexUUID, SimpleEntry.Serializer.INSTANCE); /* *************** *** 126,130 **** * and leaves onto the store. */ ! BTree groundTruth = new BTree(store, 3, SimpleEntry.Serializer.INSTANCE); final int limit = 10000; --- 130,134 ---- * and leaves onto the store. */ ! BTree groundTruth = new BTree(store, 3, indexUUID, SimpleEntry.Serializer.INSTANCE); final int limit = 10000; Index: TestTouch.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestTouch.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestTouch.java 9 Feb 2007 16:13:18 -0000 1.5 --- TestTouch.java 27 Mar 2007 14:34:21 -0000 1.6 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.objndx; + import java.util.UUID; + import com.bigdata.rawstore.SimpleMemoryRawStore; *************** *** 102,105 **** --- 104,108 ---- new SimpleMemoryRawStore(), branchingFactor, + UUID.randomUUID(), leafQueue, SimpleEntry.Serializer.INSTANCE, *************** *** 173,176 **** --- 176,180 ---- new SimpleMemoryRawStore(), branchingFactor, + UUID.randomUUID(), leafQueue, SimpleEntry.Serializer.INSTANCE, *************** *** 246,249 **** --- 250,254 ---- new SimpleMemoryRawStore(), branchingFactor, + UUID.randomUUID(), leafQueue, valSer, Index: TestCommit.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestCommit.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestCommit.java 11 Mar 2007 11:42:50 -0000 1.13 --- TestCommit.java 27 Mar 2007 14:34:21 -0000 1.14 *************** *** 48,54 **** package com.bigdata.objndx; import junit.framework.TestCase2; - import com.bigdata.cache.HardReferenceQueue; import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; --- 48,55 ---- package com.bigdata.objndx; + import java.util.UUID; + import junit.framework.TestCase2; import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; *************** *** 59,64 **** * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ - * - * FIXME This suite should verify that */ public class TestCommit extends TestCase2 { --- 60,63 ---- *************** *** 94,105 **** { ! BTree btree = new BTree(store, ! branchingFactor, ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! BTree.DEFAULT_HARD_REF_QUEUE_CAPACITY, ! BTree.DEFAULT_HARD_REF_QUEUE_SCAN), ! SimpleEntry.Serializer.INSTANCE, ! null // no record compressor ! ); assertTrue(btree.root.isDirty()); --- 93,98 ---- { ! BTree btree = new BTree(store, branchingFactor, UUID.randomUUID(), ! SimpleEntry.Serializer.INSTANCE); assertTrue(btree.root.isDirty()); Index: AbstractBTreeTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/AbstractBTreeTestCase.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** AbstractBTreeTestCase.java 8 Mar 2007 18:14:05 -0000 1.31 --- AbstractBTreeTestCase.java 27 Mar 2007 14:34:21 -0000 1.32 *************** *** 52,55 **** --- 52,56 ---- import java.util.Random; import java.util.TreeMap; + import java.util.UUID; import junit.framework.AssertionFailedError; *************** *** 492,496 **** final int nscan = 10; ! BTree btree = new BTree(store, branchingFactor, new HardReferenceQueue<PO>(new NoEvictionListener(), leafQueueCapacity, nscan), --- 493,497 ---- final int nscan = 10; ! BTree btree = new BTree(store, branchingFactor, UUID.randomUUID(), new HardReferenceQueue<PO>(new NoEvictionListener(), leafQueueCapacity, nscan), *************** *** 1554,1557 **** --- 1555,1560 ---- assert actual != null; + assertEquals("indexUUID",expected.getIndexUUID(), actual.getIndexUUID()); + // The #of entries must agree. assertEquals("entryCount",expected.getEntryCount(), actual.getEntryCount()); Index: TestRestartSafe.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestRestartSafe.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestRestartSafe.java 22 Mar 2007 21:11:24 -0000 1.7 --- TestRestartSafe.java 27 Mar 2007 14:34:21 -0000 1.8 *************** *** 51,54 **** --- 51,55 ---- import java.io.IOException; import java.util.Properties; + import java.util.UUID; import org.apache.log4j.Level; *************** *** 145,149 **** public BTree getBTree(int branchingFactor, Journal journal) { ! BTree btree = new BTree(journal, branchingFactor, SimpleEntry.Serializer.INSTANCE); --- 146,150 ---- public BTree getBTree(int branchingFactor, Journal journal) { ! BTree btree = new BTree(journal, branchingFactor, UUID.randomUUID(), SimpleEntry.Serializer.INSTANCE); Index: TestIncrementalWrite.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIncrementalWrite.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestIncrementalWrite.java 9 Feb 2007 16:13:18 -0000 1.7 --- TestIncrementalWrite.java 27 Mar 2007 14:34:21 -0000 1.8 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.objndx; + import java.util.UUID; + import com.bigdata.cache.HardReferenceQueue; import com.bigdata.rawstore.IRawStore; *************** *** 83,86 **** --- 85,89 ---- BTree btree = new BTree(store, branchingFactor, + UUID.randomUUID(), new MyHardReferenceQueue<PO>(new DefaultEvictionListener(), queueCapacity, queueScan), Index: TestNodeSerializer.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestNodeSerializer.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TestNodeSerializer.java 12 Mar 2007 18:06:12 -0000 1.16 --- TestNodeSerializer.java 27 Mar 2007 14:34:21 -0000 1.17 *************** *** 52,55 **** --- 52,56 ---- import java.util.Set; import java.util.TreeSet; + import java.util.UUID; import org.apache.log4j.Level; *************** *** 278,282 **** final int nscan = 10; ! BTree btree = new BTree(store, branchingFactor, new HardReferenceQueue<PO>(new NoEvictionListener(), leafQueueCapacity, nscan), --- 279,283 ---- final int nscan = 10; ! BTree btree = new BTree(store, branchingFactor, UUID.randomUUID(), new HardReferenceQueue<PO>(new NoEvictionListener(), leafQueueCapacity, nscan), |