From: Bryan T. <tho...@us...> - 2007-03-08 18:14:39
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15000/src/test/com/bigdata/objndx Modified Files: TestIndexSegmentWithBloomFilter.java TestIndexSegmentBuilderWithSmallTree.java TestIndexSegmentBuilderWithLargeTrees.java AbstractBTreeTestCase.java TestAll.java TestIndexSegmentMerger.java Added Files: TestIndexSegmentFastLeafScan.java Log Message: Updated the UML model and added a ZIP containing an HTML presentation of the model. Working on partitioned index support. Index: TestIndexSegmentBuilderWithLargeTrees.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentBuilderWithLargeTrees.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestIndexSegmentBuilderWithLargeTrees.java 22 Feb 2007 16:59:35 -0000 1.10 --- TestIndexSegmentBuilderWithLargeTrees.java 8 Mar 2007 18:14:05 -0000 1.11 *************** *** 278,286 **** IndexSegmentBuilder builder = new IndexSegmentBuilder(outFile, ! tmpDir, btree, m, 0.); - // @todo verify post-condition for the temporary file. - // assertFalse(builder.tmp) - /* * Verify can load the index file and that the metadata --- 278,287 ---- IndexSegmentBuilder builder = new IndexSegmentBuilder(outFile, ! tmpDir, btree, m, 0. ! /* ! * @todo pass in btree.nodeSer.valueSerializer ! */ ! ); /* * Verify can load the index file and that the metadata *************** *** 291,300 **** */ System.err.println("Opening index segment."); ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 100, 20), ! // take the other parameters from the btree. ! btree.nodeSer.valueSerializer); /* * Verify the total index order. --- 292,296 ---- */ System.err.println("Opening index segment."); ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); /* * Verify the total index order. Index: TestIndexSegmentWithBloomFilter.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentWithBloomFilter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestIndexSegmentWithBloomFilter.java 22 Feb 2007 16:59:35 -0000 1.8 --- TestIndexSegmentWithBloomFilter.java 8 Mar 2007 18:14:05 -0000 1.9 *************** *** 283,291 **** */ System.err.println("Opening index segment w/ bloom filter."); ! final IndexSegment seg2 = new IndexSegment(new IndexSegmentFileStore(outFile2), ! // setup reference queue. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 100, 20), ! btree.nodeSer.valueSerializer); /* --- 283,291 ---- */ System.err.println("Opening index segment w/ bloom filter."); ! final IndexSegment seg2 = new IndexSegmentFileStore(outFile2).load(); ! // // setup reference queue. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 100, 20), ! // @todo btree.nodeSer.valueSerializer); /* *************** *** 378,386 **** */ System.err.println("Opening index segment w/o bloom filter."); ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 100, 20), ! btree.nodeSer.valueSerializer); /* --- 378,386 ---- */ System.err.println("Opening index segment w/o bloom filter."); ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 100, 20), ! // @todo btree.nodeSer.valueSerializer); /* *************** *** 392,400 **** */ System.err.println("Opening index segment w/ bloom filter."); ! final IndexSegment seg2 = new IndexSegment(new IndexSegmentFileStore(outFile2), ! // setup reference queue. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 100, 20), ! btree.nodeSer.valueSerializer); /* --- 392,400 ---- */ System.err.println("Opening index segment w/ bloom filter."); ! final IndexSegment seg2 = new IndexSegmentFileStore(outFile2).load(); ! // // setup reference queue. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 100, 20), ! // @todo btree.nodeSer.valueSerializer); /* Index: TestIndexSegmentBuilderWithSmallTree.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentBuilderWithSmallTree.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestIndexSegmentBuilderWithSmallTree.java 29 Jan 2007 20:37:38 -0000 1.9 --- TestIndexSegmentBuilderWithSmallTree.java 8 Mar 2007 18:14:05 -0000 1.10 *************** *** 7,12 **** import org.apache.log4j.Level; - import com.bigdata.cache.HardReferenceQueue; - /** * Test suite based on a small btree with known keys and values. --- 7,10 ---- *************** *** 124,133 **** * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue to hold all leaves and nodes. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 7, 7), ! // take the other parameters from the btree. ! btree.nodeSer.valueSerializer); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(2,seg.getHeight()); --- 122,131 ---- * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue to hold all leaves and nodes. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 7, 7), ! // // take the other parameters from the btree. ! // @todo btree.nodeSer.valueSerializer); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(2,seg.getHeight()); *************** *** 198,208 **** * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue to hold all leaves and nodes. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 3, 3), ! // take the other parameters from the btree. ! btree.nodeSer.valueSerializer ! ); TestIndexSegmentPlan.assertEquals(9,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(1,seg.getHeight()); --- 196,206 ---- * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue to hold all leaves and nodes. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 3, 3), ! // // take the other parameters from the btree. ! // @todo btree.nodeSer.valueSerializer ! // ); TestIndexSegmentPlan.assertEquals(9,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(1,seg.getHeight()); *************** *** 258,268 **** * of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue to hold all leaves and nodes. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 1, 1), ! // take the other parameters from the btree. ! btree.nodeSer.valueSerializer ! ); TestIndexSegmentPlan.assertEquals(10,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(0,seg.getHeight()); --- 256,266 ---- * of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue to hold all leaves and nodes. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 1, 1), ! // // take the other parameters from the btree. ! // @todo btree.nodeSer.valueSerializer ! // ); TestIndexSegmentPlan.assertEquals(10,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(0,seg.getHeight()); *************** *** 339,348 **** * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue to hold all leaves and nodes. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 3, 3), ! btree.nodeSer.valueSerializer ! ); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(1,seg.getHeight()); --- 337,346 ---- * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue to hold all leaves and nodes. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 3, 3), ! // @todo btree.nodeSer.valueSerializer ! // ); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(1,seg.getHeight()); *************** *** 432,441 **** * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegment(new IndexSegmentFileStore(outFile), ! // setup reference queue to hold all leaves and nodes. ! new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! 11, 11), ! btree.nodeSer.valueSerializer ! ); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(2,seg.getHeight()); --- 430,439 ---- * specifics of the length of serialized nodes or leaves). */ ! final IndexSegment seg = new IndexSegmentFileStore(outFile).load(); ! // // setup reference queue to hold all leaves and nodes. ! // new HardReferenceQueue<PO>(new DefaultEvictionListener(), ! // 11, 11), ! // @todo btree.nodeSer.valueSerializer ! // ); TestIndexSegmentPlan.assertEquals(3,seg.getBranchingFactor()); TestIndexSegmentPlan.assertEquals(2,seg.getHeight()); Index: TestAll.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestAll.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** TestAll.java 21 Feb 2007 20:17:22 -0000 1.30 --- TestAll.java 8 Mar 2007 18:14:05 -0000 1.31 *************** *** 126,129 **** --- 126,131 ---- // test of the bloom filter integration. suite.addTestSuite( TestIndexSegmentWithBloomFilter.class ); + // test of the fast forward and reverse leaf scans. + suite.addTestSuite( TestIndexSegmentFastLeafScan.class ); // test compacting merge of two index segments. suite.addTestSuite( TestIndexSegmentMerger.class ); Index: AbstractBTreeTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/AbstractBTreeTestCase.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AbstractBTreeTestCase.java 22 Feb 2007 16:59:35 -0000 1.30 --- AbstractBTreeTestCase.java 8 Mar 2007 18:14:05 -0000 1.31 *************** *** 1660,1664 **** try { ! assertEquals(expectedVal, actualVal); } catch (AssertionFailedError ex) { --- 1660,1664 ---- try { ! assertSameValue(expectedVal, actualVal); } catch (AssertionFailedError ex) { *************** *** 1666,1672 **** * Lazily generate message. */ ! fail("Values differ: index=" + index + ", key=" ! + BytesUtil.toString(expectedKey) + ", expected=" ! + expectedVal + ", actual=" + actualVal, ex); } --- 1666,1679 ---- * Lazily generate message. */ ! fail("Values differ: index=" ! + index ! + ", key=" ! + BytesUtil.toString(expectedKey) ! + ", expected=" ! + (expectedVal instanceof byte[] ? BytesUtil ! .toString((byte[]) expectedVal) : expectedVal) ! + ", actual=" ! + (actualVal instanceof byte[] ? BytesUtil ! .toString((byte[]) actualVal) : actualVal), ex); } --- NEW FILE: TestIndexSegmentFastLeafScan.java --- /** The Notice below must appear in each file of the Source Code of any copy you distribute of the Licensed Product. Contributors to any Modifications may add their own copyright notices to identify their own contributions. License: The contents of this file are subject to the CognitiveWeb Open Source License Version 1.1 (the License). You may not copy or use this file, in either source code or executable form, except in compliance with the License. You may obtain a copy of the License from http://www.CognitiveWeb.org/legal/license/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyrights: Portions created by or assigned to CognitiveWeb are Copyright (c) 2003-2003 CognitiveWeb. All Rights Reserved. Contact information for CognitiveWeb is available at http://www.CognitiveWeb.org Portions Copyright (c) 2002-2003 Bryan Thompson. Acknowledgements: Special thanks to the developers of the Jabber Open Source License 1.0 (JOSL), from which this License was derived. This License contains terms that differ from JOSL. Special thanks to the CognitiveWeb Open Source Contributors for their suggestions and support of the Cognitive Web. Modifications: */ /* * Created on Mar 7, 2007 */ package com.bigdata.objndx; /** * Test suite for verification of fast forward and reverse leaf scans for * {@link IndexSegment}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ public class TestIndexSegmentFastLeafScan extends AbstractBTreeTestCase { /** * */ public TestIndexSegmentFastLeafScan() { } /** * @param name */ public TestIndexSegmentFastLeafScan(String name) { super(name); } public void test_fastForwardScan() { fail("write test"); } public void test_fastReverseScan() { fail("write test"); } } Index: TestIndexSegmentMerger.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/objndx/TestIndexSegmentMerger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestIndexSegmentMerger.java 6 Mar 2007 20:38:06 -0000 1.4 --- TestIndexSegmentMerger.java 8 Mar 2007 18:14:05 -0000 1.5 *************** *** 48,52 **** package com.bigdata.objndx; - import java.io.File; import java.io.IOException; --- 48,51 ---- *************** *** 56,59 **** --- 55,63 ---- * Test suite for compacting merge of B+-Trees. * + * @todo write tests of a key range merge (feature not supported yet, but + * required for partitioned index segment builds). + * + * @todo test N-way merge. + * * @todo write tests where the keys do not overlap (done). * *************** *** 103,119 **** super(name); } - - /** - * Return the temporary directory. - */ - static synchronized protected File getTempDir() { - - File tmpDir = new File(System.getProperty("java.io.tmpdir")); - - assertTrue(!tmpDir.exists() || tmpDir.mkdirs()); - - return tmpDir; - - } /** --- 107,110 ---- |