From: Bryan T. <tho...@us...> - 2007-03-11 11:43:24
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5433/src/test/com/bigdata/scaleup Modified Files: TestPartitionedIndex.java TestMetadataIndex.java TestPartitionedJournal.java Log Message: Continued minor refactoring in line with model updates. Index: TestMetadataIndex.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup/TestMetadataIndex.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestMetadataIndex.java 8 Mar 2007 18:14:06 -0000 1.9 --- TestMetadataIndex.java 11 Mar 2007 11:42:48 -0000 1.10 *************** *** 61,67 **** import com.bigdata.objndx.AbstractBTreeTestCase; import com.bigdata.objndx.BTree; - import com.bigdata.objndx.BTreeMetadata; import com.bigdata.objndx.BatchInsert; ! import com.bigdata.objndx.FusedView; import com.bigdata.objndx.IndexSegment; import com.bigdata.objndx.IndexSegmentBuilder; --- 61,66 ---- import com.bigdata.objndx.AbstractBTreeTestCase; import com.bigdata.objndx.BTree; import com.bigdata.objndx.BatchInsert; ! import com.bigdata.objndx.ReadOnlyFusedView; import com.bigdata.objndx.IndexSegment; import com.bigdata.objndx.IndexSegmentBuilder; *************** *** 268,272 **** // re-load the index. ! md = (MetadataIndex)BTreeMetadata.load(store, addr); assertEquals("name","abc",md.getName()); --- 267,271 ---- // re-load the index. ! md = (MetadataIndex)BTree.load(store, addr); assertEquals("name","abc",md.getName()); *************** *** 468,472 **** * verify the fused view is the same as the data already on the btree. */ ! FusedView view = new FusedView(new AbstractBTree[]{btree,seg}); assertSameIterator(new Object[] { v1, v2, v3, v4, v5, v6, v7, v8 }, --- 467,471 ---- * verify the fused view is the same as the data already on the btree. */ ! ReadOnlyFusedView view = new ReadOnlyFusedView(new AbstractBTree[]{btree,seg}); assertSameIterator(new Object[] { v1, v2, v3, v4, v5, v6, v7, v8 }, *************** *** 573,577 **** * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v1, v3, v5, v7 }, new FusedView( new AbstractBTree[] { btree, seg01 }).rangeIterator(null, null)); --- 572,576 ---- * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v1, v3, v5, v7 }, new ReadOnlyFusedView( new AbstractBTree[] { btree, seg01 }).rangeIterator(null, null)); *************** *** 1041,1045 **** * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v1, v3, v5, v7 }, new FusedView( new AbstractBTree[] { btree, seg01 }).rangeIterator(null, null)); --- 1040,1044 ---- * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v1, v3, v5, v7 }, new ReadOnlyFusedView( new AbstractBTree[] { btree, seg01 }).rangeIterator(null, null)); *************** *** 1085,1089 **** * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v2, v4, v6, v8 }, new FusedView( new AbstractBTree[] { btree, seg02 }).rangeIterator(null, null)); --- 1084,1088 ---- * verify the fused view is the same as the data already on the btree. */ ! assertSameIterator(new Object[] { v2, v4, v6, v8 }, new ReadOnlyFusedView( new AbstractBTree[] { btree, seg02 }).rangeIterator(null, null)); *************** *** 1093,1097 **** */ assertSameIterator(new Object[] { v1, v2, v3, v4, v5, v6, v7, v8 }, ! new FusedView(new AbstractBTree[] { seg01, seg02 }) .rangeIterator(null, null)); --- 1092,1096 ---- */ assertSameIterator(new Object[] { v1, v2, v3, v4, v5, v6, v7, v8 }, ! new ReadOnlyFusedView(new AbstractBTree[] { seg01, seg02 }) .rangeIterator(null, null)); Index: TestPartitionedIndex.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup/TestPartitionedIndex.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestPartitionedIndex.java 8 Mar 2007 18:14:06 -0000 1.2 --- TestPartitionedIndex.java 11 Mar 2007 11:42:47 -0000 1.3 *************** *** 54,58 **** /** ! * Test suite for {@link PartitionedIndex}. * * @todo This should be refactored to test when using {@link BTree} as well as --- 54,58 ---- /** ! * Test suite for {@link PartitionedIndexView}. * * @todo This should be refactored to test when using {@link BTree} as well as *************** *** 61,65 **** * from {@link BTree} to {@link UnisolatedBTree} highlights many assumptions * in {@link IndexSegmentBuilder}, {@link IndexSegmentMerger}, and the ! * code that handles {@link PartitionedJournal#overflow()}. * * @todo where possible, it would be nice to leverage the unit tests for the --- 61,65 ---- * from {@link BTree} to {@link UnisolatedBTree} highlights many assumptions * in {@link IndexSegmentBuilder}, {@link IndexSegmentMerger}, and the ! * code that handles {@link MasterJournal#overflow()}. * * @todo where possible, it would be nice to leverage the unit tests for the Index: TestPartitionedJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup/TestPartitionedJournal.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestPartitionedJournal.java 8 Mar 2007 18:14:06 -0000 1.5 --- TestPartitionedJournal.java 11 Mar 2007 11:42:48 -0000 1.6 *************** *** 61,66 **** import com.bigdata.objndx.KeyBuilder; import com.bigdata.rawstore.SimpleMemoryRawStore; ! import com.bigdata.scaleup.PartitionedJournal.MergePolicy; ! import com.bigdata.scaleup.PartitionedJournal.Options; /** --- 61,66 ---- import com.bigdata.objndx.KeyBuilder; import com.bigdata.rawstore.SimpleMemoryRawStore; ! import com.bigdata.scaleup.MasterJournal.MergePolicy; ! import com.bigdata.scaleup.MasterJournal.Options; /** *************** *** 139,143 **** properties.setProperty(Options.BASENAME,getName()); ! PartitionedJournal journal = new PartitionedJournal(properties); final String name = "abc"; --- 139,143 ---- properties.setProperty(Options.BASENAME,getName()); ! MasterJournal journal = new MasterJournal(properties); final String name = "abc"; *************** *** 149,155 **** index = journal.registerIndex(name, index); ! assertTrue(journal.getIndex(name) instanceof PartitionedIndex); ! assertEquals("name", name, ((PartitionedIndex) journal.getIndex(name)) .getName()); --- 149,155 ---- index = journal.registerIndex(name, index); ! assertTrue(journal.getIndex(name) instanceof PartitionedIndexView); ! assertEquals("name", name, ((PartitionedIndexView) journal.getIndex(name)) .getName()); *************** *** 175,184 **** * re-open the journal and test restart safety. */ ! journal = new PartitionedJournal(properties); ! index = (PartitionedIndex) journal.getIndex(name); assertNotNull("btree", index); ! assertEquals("entryCount", 1, ((PartitionedIndex)index).getBTree().getEntryCount()); assertEquals(v0, (byte[])index.lookup(k0)); --- 175,184 ---- * re-open the journal and test restart safety. */ ! journal = new MasterJournal(properties); ! index = (PartitionedIndexView) journal.getIndex(name); assertNotNull("btree", index); ! assertEquals("entryCount", 1, ((PartitionedIndexView)index).getBTree().getEntryCount()); assertEquals(v0, (byte[])index.lookup(k0)); *************** *** 205,209 **** properties.setProperty(Options.BASENAME,getName()); ! PartitionedJournal journal = new PartitionedJournal(properties); final String name = "abc"; --- 205,209 ---- properties.setProperty(Options.BASENAME,getName()); ! MasterJournal journal = new MasterJournal(properties); final String name = "abc"; *************** *** 239,243 **** properties.setProperty(Options.BASENAME,getName()); ! PartitionedJournal journal = new PartitionedJournal(properties); final String name = "abc"; --- 239,243 ---- properties.setProperty(Options.BASENAME,getName()); ! MasterJournal journal = new MasterJournal(properties); final String name = "abc"; *************** *** 289,293 **** MergePolicy.CompactingMerge.toString()); ! PartitionedJournal journal = new PartitionedJournal(properties); final String name = "abc"; --- 289,293 ---- MergePolicy.CompactingMerge.toString()); ! MasterJournal journal = new MasterJournal(properties); final String name = "abc"; *************** *** 323,327 **** * Verify that the btree is empty. */ ! assertEquals(0, ((PartitionedIndex) journal.getIndex(name)).getBTree() .getEntryCount()); --- 323,327 ---- * Verify that the btree is empty. */ ! assertEquals(0, ((PartitionedIndexView) journal.getIndex(name)).getBTree() .getEntryCount()); *************** *** 354,358 **** MergePolicy.CompactingMerge.toString()); ! PartitionedJournal journal = new PartitionedJournal(properties); final String name = "abc"; --- 354,358 ---- MergePolicy.CompactingMerge.toString()); ! MasterJournal journal = new MasterJournal(properties); final String name = "abc"; *************** *** 410,414 **** * Verify that the btree is empty. */ ! assertEquals(0, ((PartitionedIndex) journal.getIndex(name)) .getBTree().getEntryCount()); --- 410,414 ---- * Verify that the btree is empty. */ ! assertEquals(0, ((PartitionedIndexView) journal.getIndex(name)) .getBTree().getEntryCount()); |