From: Bryan T. <tho...@us...> - 2007-03-27 14:34:57
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6186/src/test/com/bigdata/journal Modified Files: TestReadCommittedTx.java TestNamedIndices.java AbstractTestTxRunState.java AbstractBTreeWithJournalTestCase.java TestConflictResolution.java TestTx.java TestReadOnlyTx.java StressTestConcurrent.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: AbstractBTreeWithJournalTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractBTreeWithJournalTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractBTreeWithJournalTestCase.java 22 Mar 2007 21:11:24 -0000 1.3 --- AbstractBTreeWithJournalTestCase.java 27 Mar 2007 14:34:20 -0000 1.4 *************** *** 49,52 **** --- 49,53 ---- import java.util.Properties; + import java.util.UUID; import com.bigdata.objndx.AbstractBTreeTestCase; *************** *** 117,121 **** Journal journal = new Journal(getProperties()); ! BTree btree = new BTree(journal, branchingFactor, SimpleEntry.Serializer.INSTANCE); --- 118,122 ---- Journal journal = new Journal(getProperties()); ! BTree btree = new BTree(journal, branchingFactor, UUID.randomUUID(), SimpleEntry.Serializer.INSTANCE); Index: TestConflictResolution.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestConflictResolution.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestConflictResolution.java 15 Mar 2007 16:11:09 -0000 1.5 --- TestConflictResolution.java 27 Mar 2007 14:34:21 -0000 1.6 *************** *** 48,52 **** package com.bigdata.journal; ! import java.util.Properties; import com.bigdata.isolation.IConflictResolver; --- 48,52 ---- package com.bigdata.journal; ! import java.util.UUID; import com.bigdata.isolation.IConflictResolver; *************** *** 142,146 **** */ ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 142,147 ---- */ ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID ! .randomUUID())); journal.commit(); *************** *** 217,221 **** journal.registerIndex(name, new UnisolatedBTree(journal, ! new SingleValueConflictResolver(k1, v1c))); journal.commit(); --- 218,222 ---- journal.registerIndex(name, new UnisolatedBTree(journal, ! UUID.randomUUID(), new SingleValueConflictResolver(k1, v1c))); journal.commit(); Index: TestNamedIndices.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestNamedIndices.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestNamedIndices.java 11 Mar 2007 11:42:34 -0000 1.3 --- TestNamedIndices.java 27 Mar 2007 14:34:20 -0000 1.4 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import java.util.UUID; + import com.bigdata.objndx.BTree; import com.bigdata.objndx.SimpleEntry; *************** *** 90,96 **** Journal journal = new Journal(getProperties()); ! String name = "abc"; ! BTree btree = new BTree(journal, 3, SimpleEntry.Serializer.INSTANCE); assertNull(journal.getIndex(name)); --- 92,101 ---- Journal journal = new Journal(getProperties()); ! final String name = "abc"; ! final UUID indexUUID = UUID.randomUUID(); ! ! BTree btree = new BTree(journal, 3, indexUUID, ! SimpleEntry.Serializer.INSTANCE); assertNull(journal.getIndex(name)); *************** *** 120,123 **** --- 125,129 ---- assertNotNull("btree", btree); + assertEquals("indexUUID", indexUUID, btree.getIndexUUID() ); assertEquals("entryCount", 1, btree.getEntryCount()); assertEquals(v0, btree.lookup(k0)); Index: TestTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTx.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TestTx.java 15 Mar 2007 16:11:09 -0000 1.21 --- TestTx.java 27 Mar 2007 14:34:21 -0000 1.22 *************** *** 48,52 **** package com.bigdata.journal; ! import java.util.Properties; import com.bigdata.isolation.IsolatedBTree; --- 48,52 ---- package com.bigdata.journal; ! import java.util.UUID; import com.bigdata.isolation.IsolatedBTree; *************** *** 121,125 **** // register index in unisolated scope, but do not commit yet. ! journal.registerIndex(name, new UnisolatedBTree(journal, 3)); // start tx1. --- 121,126 ---- // register index in unisolated scope, but do not commit yet. ! journal.registerIndex(name, new UnisolatedBTree(journal, 3, UUID ! .randomUUID())); // start tx1. *************** *** 163,167 **** { ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 164,168 ---- { ! journal.registerIndex(name, new UnisolatedBTree(journal,UUID.randomUUID())); journal.commit(); *************** *** 221,225 **** IIndex index = journal.registerIndex(name, new UnisolatedBTree( ! journal, branchingFactor)); assertNull(index.insert(k1, v1)); --- 222,226 ---- IIndex index = journal.registerIndex(name, new UnisolatedBTree( ! journal, branchingFactor, UUID.randomUUID())); assertNull(index.insert(k1, v1)); *************** *** 327,331 **** journal.registerIndex(name, new UnisolatedBTree(journal, ! branchingFactor)); assert(journal.commit()!=0L); --- 328,332 ---- journal.registerIndex(name, new UnisolatedBTree(journal, ! branchingFactor, UUID.randomUUID())); assert(journal.commit()!=0L); *************** *** 437,441 **** * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 438,443 ---- * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID ! .randomUUID())); journal.commit(); *************** *** 526,530 **** * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 528,532 ---- * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID.randomUUID())); journal.commit(); *************** *** 633,637 **** * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 635,639 ---- * register an index and commit the journal. */ ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID.randomUUID())); journal.commit(); *************** *** 1160,1164 **** { ! journal.registerIndex(name,new UnisolatedBTree(journal)); journal.commit(); --- 1162,1166 ---- { ! journal.registerIndex(name,new UnisolatedBTree(journal,UUID.randomUUID())); journal.commit(); *************** *** 1248,1252 **** { ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 1250,1254 ---- { ! journal.registerIndex(name, new UnisolatedBTree(journal,UUID.randomUUID())); journal.commit(); Index: StressTestConcurrent.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/StressTestConcurrent.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StressTestConcurrent.java 22 Mar 2007 21:11:24 -0000 1.10 --- StressTestConcurrent.java 27 Mar 2007 14:34:21 -0000 1.11 *************** *** 54,57 **** --- 54,58 ---- import java.util.Properties; import java.util.Random; + import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; *************** *** 147,151 **** { // Setup the named index and commit the journal. ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 148,152 ---- { // Setup the named index and commit the journal. ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID.randomUUID())); journal.commit(); Index: TestReadCommittedTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestReadCommittedTx.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestReadCommittedTx.java 28 Feb 2007 13:59:09 -0000 1.2 --- TestReadCommittedTx.java 27 Mar 2007 14:34:20 -0000 1.3 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import java.util.UUID; + import com.bigdata.isolation.UnisolatedBTree; import com.bigdata.objndx.IIndex; *************** *** 91,95 **** */ IIndex ndx = journal.registerIndex(name, new UnisolatedBTree( ! journal)); ndx.insert(k1, v1); --- 93,97 ---- */ IIndex ndx = journal.registerIndex(name, new UnisolatedBTree( ! journal, UUID.randomUUID())); ndx.insert(k1, v1); *************** *** 191,195 **** // register an index and commit the journal. ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 193,198 ---- // register an index and commit the journal. ! journal.registerIndex(name, new UnisolatedBTree(journal, ! UUID.randomUUID())); journal.commit(); Index: AbstractTestTxRunState.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractTestTxRunState.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractTestTxRunState.java 15 Mar 2007 16:11:09 -0000 1.2 --- AbstractTestTxRunState.java 27 Mar 2007 14:34:20 -0000 1.3 *************** *** 49,52 **** --- 49,53 ---- import java.io.IOException; + import java.util.UUID; import junit.framework.TestSuite; *************** *** 481,485 **** { ! journal.registerIndex(name, new UnisolatedBTree(journal)); journal.commit(); --- 482,487 ---- { ! journal.registerIndex(name, new UnisolatedBTree(journal, UUID ! .randomUUID())); journal.commit(); Index: TestReadOnlyTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestReadOnlyTx.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestReadOnlyTx.java 28 Feb 2007 13:59:09 -0000 1.5 --- TestReadOnlyTx.java 27 Mar 2007 14:34:21 -0000 1.6 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import java.util.UUID; + import com.bigdata.isolation.UnisolatedBTree; import com.bigdata.objndx.IIndex; *************** *** 91,95 **** */ IIndex ndx = journal.registerIndex(name, new UnisolatedBTree( ! journal)); ndx.insert(k1, v1); --- 93,97 ---- */ IIndex ndx = journal.registerIndex(name, new UnisolatedBTree( ! journal, UUID.randomUUID())); ndx.insert(k1, v1); |