From: Bryan T. <tho...@us...> - 2007-04-25 16:05:41
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/service In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11220/src/test/com/bigdata/service Modified Files: TestBigdataClient.java TestMetadataServer0.java Log Message: Implemented range count for partitioned indices. Index: TestBigdataClient.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/service/TestBigdataClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestBigdataClient.java 25 Apr 2007 14:57:10 -0000 1.2 --- TestBigdataClient.java 25 Apr 2007 16:05:37 -0000 1.3 *************** *** 220,227 **** // verify some range counts. - // @todo test with rangeCount(null,null). assertEquals(0,ndx.rangeCount(new byte[]{}, new byte[]{1})); assertEquals(1,ndx.rangeCount(new byte[]{}, new byte[]{2})); assertEquals(1,ndx.rangeCount(new byte[]{1}, new byte[]{2})); // remove the index entry. --- 220,230 ---- // verify some range counts. assertEquals(0,ndx.rangeCount(new byte[]{}, new byte[]{1})); assertEquals(1,ndx.rangeCount(new byte[]{}, new byte[]{2})); assertEquals(1,ndx.rangeCount(new byte[]{1}, new byte[]{2})); + assertEquals(0,ndx.rangeCount(null, new byte[]{1})); + assertEquals(1,ndx.rangeCount(new byte[]{1},null)); + assertEquals(1,ndx.rangeCount(null,new byte[]{2})); + assertEquals(1,ndx.rangeCount(null,null)); // remove the index entry. *************** *** 241,250 **** * relevant index partition(s) need to be compacted for those deletion * markers to be removed and the range counts adjusted to match. - * - * @todo test with rangeCount(null,null). */ assertEquals(0,ndx.rangeCount(new byte[]{}, new byte[]{1})); assertEquals(1,ndx.rangeCount(new byte[]{}, new byte[]{2})); assertEquals(1,ndx.rangeCount(new byte[]{1}, new byte[]{2})); } --- 244,255 ---- * relevant index partition(s) need to be compacted for those deletion * markers to be removed and the range counts adjusted to match. */ assertEquals(0,ndx.rangeCount(new byte[]{}, new byte[]{1})); assertEquals(1,ndx.rangeCount(new byte[]{}, new byte[]{2})); assertEquals(1,ndx.rangeCount(new byte[]{1}, new byte[]{2})); + assertEquals(0,ndx.rangeCount(null, new byte[]{1})); + assertEquals(1,ndx.rangeCount(new byte[]{1},null)); + assertEquals(1,ndx.rangeCount(null,new byte[]{2})); + assertEquals(1,ndx.rangeCount(null,null)); } Index: TestMetadataServer0.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/service/TestMetadataServer0.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestMetadataServer0.java 25 Apr 2007 14:57:10 -0000 1.5 --- TestMetadataServer0.java 25 Apr 2007 16:05:37 -0000 1.6 *************** *** 335,343 **** */ ! IPartitionMetadata pmd = metadataServiceProxy.getPartition(indexName, ! new byte[] {}); ! ! assertNotNull(pmd); /* * Resolve the data service to which the initial index partition was --- 335,351 ---- */ ! IPartitionMetadata pmd; + { + + byte[] val = metadataServiceProxy.getPartition(indexName, + new byte[] {}); + + assertNotNull(val); + + pmd = (IPartitionMetadata) SerializerUtil.deserialize(val); + + } + /* * Resolve the data service to which the initial index partition was |