This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(139) |
Aug
(94) |
Sep
(232) |
Oct
(143) |
Nov
(138) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(127) |
Feb
(90) |
Mar
(101) |
Apr
(74) |
May
(148) |
Jun
(241) |
Jul
(169) |
Aug
(121) |
Sep
(157) |
Oct
(199) |
Nov
(281) |
Dec
(75) |
2012 |
Jan
(107) |
Feb
(122) |
Mar
(184) |
Apr
(73) |
May
(14) |
Jun
(49) |
Jul
(26) |
Aug
(103) |
Sep
(133) |
Oct
(61) |
Nov
(51) |
Dec
(55) |
2013 |
Jan
(59) |
Feb
(72) |
Mar
(99) |
Apr
(62) |
May
(92) |
Jun
(19) |
Jul
(31) |
Aug
(138) |
Sep
(47) |
Oct
(83) |
Nov
(95) |
Dec
(111) |
2014 |
Jan
(125) |
Feb
(60) |
Mar
(119) |
Apr
(136) |
May
(270) |
Jun
(83) |
Jul
(88) |
Aug
(30) |
Sep
(47) |
Oct
(27) |
Nov
(23) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mar...@us...> - 2010-09-28 10:08:31
|
Revision: 3649 http://bigdata.svn.sourceforge.net/bigdata/?rev=3649&view=rev Author: martyncutcher Date: 2010-09-28 10:08:25 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Fix addFilter to initialize list if required Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java 2010-09-28 10:04:24 UTC (rev 3648) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java 2010-09-28 10:08:25 UTC (rev 3649) @@ -26,6 +26,7 @@ package cutthecrap.utils.striterators; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; import java.util.List; @@ -72,6 +73,7 @@ public boolean hasNext() { if (m_src == null) compile(realSource); + return m_src.hasNext(); } @@ -99,8 +101,10 @@ /** creates a Filterator to apply the filter **/ public IStriterator addFilter(final IFilter filter) { - if (filters != null) - filters.add(filter); + if (filters == null) + filters = new ArrayList<IFilter>(); + + filters.add(filter); return this; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dm...@us...> - 2010-09-28 10:04:30
|
Revision: 3648 http://bigdata.svn.sourceforge.net/bigdata/?rev=3648&view=rev Author: dmacgbr Date: 2010-09-28 10:04:24 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Modified operators and corresponding tests for the 'not yet bound' issue. (See Trac #179) Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -73,13 +73,13 @@ final IConstant<?> x = s.get((IVariable<?>) get(0)/* x */); if (x == null) - return false; // not bound. + return true; // not yet bound. // get binding for "y". final IConstant<?> y = s.get((IVariable<?>) get(1)/* y */); if (y == null) - return false; // not bound. + return true; // not yet bound. return x.equals(y); Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -78,7 +78,7 @@ final IConstant<?> asBound = bset.get(var); if (asBound == null) - return false; // not bound. + return true; // not yet bound. final IConstant<?> cnst = (IConstant<?>) get(1); Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -181,8 +181,8 @@ if (x == null) { - // not bound - return false; + // not yet bound : @todo should this reject an unbound variable? + return true; } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -159,8 +159,8 @@ if (x == null) { - // not bound. - return false; + // not yet bound. + return true; } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -114,7 +114,7 @@ } - public void test_eval_correct_unblound() { + public void test_eval_correct_unbound() { final EQ op = new EQ(Var.var("x"), Var.var("y")); @@ -122,7 +122,7 @@ new IVariable[] { Var.var("x") }, // new IConstant[] { new Constant<String>("1") }); - assertFalse(op.accept(bs1)); + assertTrue(op.accept(bs1)); } } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -91,6 +91,6 @@ assertTrue ( op.accept ( eq ) ) ; assertFalse ( op.accept ( ne1 ) ) ; assertFalse ( op.accept ( ne2 ) ) ; - assertFalse ( op.accept ( nb ) ) ; + assertTrue ( op.accept ( nb ) ) ; } } \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java 2010-09-28 09:48:02 UTC (rev 3647) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java 2010-09-28 10:04:24 UTC (rev 3648) @@ -125,7 +125,7 @@ assertTrue ( op.accept ( in ) ) ; assertFalse ( op.accept ( notin ) ) ; - assertFalse ( op.accept ( nb ) ) ; + assertTrue ( op.accept ( nb ) ) ; } protected abstract INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-28 09:48:09
|
Revision: 3647 http://bigdata.svn.sourceforge.net/bigdata/?rev=3647&view=rev Author: thompsonbry Date: 2010-09-28 09:48:02 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Removed references to the test class "E" and to MockRunningQuery from the main code. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java 2010-09-28 00:25:49 UTC (rev 3646) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java 2010-09-28 09:48:02 UTC (rev 3647) @@ -45,7 +45,6 @@ import com.bigdata.bop.IPredicate; import com.bigdata.bop.IVariable; import com.bigdata.bop.NV; -import com.bigdata.bop.ap.E; import com.bigdata.bop.ap.Predicate; import com.bigdata.bop.bset.StartOp; import com.bigdata.bop.join.PipelineJoin; @@ -206,7 +205,7 @@ } } - final BindingSetPipelineOp joinOp = new PipelineJoin<E>(// + final BindingSetPipelineOp joinOp = new PipelineJoin(// left, pred,// NV.asMap(new NV[] {// new NV(BOp.Annotations.BOP_ID, joinId),// @@ -256,8 +255,8 @@ for (BOp arg : args) { toString(arg, sb, indent+4); } - IConstraint[] constraints = - bop.getProperty(PipelineJoin.Annotations.CONSTRAINTS); + IConstraint[] constraints = (IConstraint[]) bop + .getProperty(PipelineJoin.Annotations.CONSTRAINTS); if (constraints != null) { for (IConstraint c : constraints) { toString(c, sb, indent+4); Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-28 00:25:49 UTC (rev 3646) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-28 09:48:02 UTC (rev 3647) @@ -2,6 +2,7 @@ import info.aduna.iteration.CloseableIteration; import info.aduna.iteration.EmptyIteration; + import java.util.Arrays; import java.util.Collection; import java.util.HashMap; @@ -15,6 +16,7 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.TimeUnit; + import org.apache.log4j.Logger; import org.openrdf.model.Literal; import org.openrdf.model.URI; @@ -48,8 +50,8 @@ import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl; import org.openrdf.query.algebra.evaluation.iterator.FilterIterator; import org.openrdf.query.algebra.helpers.QueryModelVisitorBase; + import com.bigdata.BigdataStatics; -import com.bigdata.bop.BOpContext; import com.bigdata.bop.BindingSetPipelineOp; import com.bigdata.bop.Constant; import com.bigdata.bop.HashBindingSet; @@ -65,9 +67,7 @@ import com.bigdata.bop.constraint.NE; import com.bigdata.bop.constraint.NEConstant; import com.bigdata.bop.constraint.OR; -import com.bigdata.bop.engine.BOpStats; import com.bigdata.bop.engine.LocalChunkMessage; -import com.bigdata.bop.engine.MockRunningQuery; import com.bigdata.bop.engine.QueryEngine; import com.bigdata.bop.engine.Rule2BOpUtility; import com.bigdata.bop.engine.RunningQuery; @@ -97,7 +97,6 @@ import com.bigdata.rdf.store.IRawTripleStore; import com.bigdata.relation.accesspath.IAccessPath; import com.bigdata.relation.accesspath.IAsynchronousIterator; -import com.bigdata.relation.accesspath.IBlockingBuffer; import com.bigdata.relation.accesspath.IBuffer; import com.bigdata.relation.accesspath.IElementFilter; import com.bigdata.relation.accesspath.ThickAsynchronousIterator; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <res...@us...> - 2010-09-28 00:25:56
|
Revision: 3646 http://bigdata.svn.sourceforge.net/bigdata/?rev=3646&view=rev Author: resendes Date: 2010-09-28 00:25:49 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Merge from maven_scaleout branch. Modified Paths: -------------- branches/bbb_cleanup/bigdata-integ/pom.xml branches/bbb_cleanup/bigdata-integ/src/test/resources/services.xml Added Paths: ----------- branches/bbb_cleanup/bigdata-integ/src/test/resources/kill_leftover_processes.sh Property Changed: ---------------- branches/bbb_cleanup/ branches/bbb_cleanup/bigdata-core/ branches/bbb_cleanup/bigdata-core/bigdata-perf/ branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources/ branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL/ branches/bbb_cleanup/bigdata-core/dsi-utils/lib/ branches/bbb_cleanup/bigdata-core/dsi-utils/src/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/osgi/ branches/bbb_cleanup/bigdata-core/src/main/deploy/bin/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties branches/bbb_cleanup/bigdata-core/src/main/java/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util/ branches/bbb_cleanup/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config branches/bbb_cleanup/bigdata-core/src/test/java/ Property changes on: branches/bbb_cleanup ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3634 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3645 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core:3588-3634 /trunk:3499 + /branches/maven_scaleout/bigdata-core:3588-3645 /trunk:3499 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3634 /trunk/bigdata-perf:3379-3541 + /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3645 /trunk/bigdata-perf:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3634 /trunk/bigdata-perf/lubm/src/resources:3379-3541 + /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3645 /trunk/bigdata-perf/lubm/src/resources:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3634 /trunk/dsi-utils/LEGAL:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3645 /trunk/dsi-utils/LEGAL:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/lib ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3634 /trunk/dsi-utils/lib:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3645 /trunk/dsi-utils/lib:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3634 /trunk/dsi-utils/src:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3645 /trunk/dsi-utils/src:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3634 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3645 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3634 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3645 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/osgi ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/osgi:3588-3634 /trunk/osgi:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/osgi:3588-3645 /trunk/osgi:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/bin ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3634 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3645 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3634 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 + /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3645 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3645 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3634 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3645 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3634 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3645 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3634 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3645 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3634 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 + /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3645 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3634 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 + /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3645 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties:3588-3634 /trunk/bigdata-sails/src/samples/com/bigdata/samples/fastload.properties:3503 /trunk/src/samples-sail/com/bigdata/samples/fastload.properties:3499 + /branches/maven_scaleout/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties:3588-3645 /trunk/bigdata-sails/src/samples/com/bigdata/samples/fastload.properties:3503 /trunk/src/samples-sail/com/bigdata/samples/fastload.properties:3499 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3588-3645 /trunk/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/config/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/config/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3588-3645 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3588-3645 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3588-3645 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/java ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/java:2594-3237 /branches/dev-btm/bigdata/src/test:3463 /branches/dev-btm/bigdata-core/src/test/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test:3463 /branches/dev-btm/bigdata-rdf/src/test:3463 /branches/dev-btm/bigdata-sails/src/test:3463 /branches/fko/bigdata-core/src/test/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/java:3588-3634 /trunk/bigdata-core/src/test/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/test:3542 /trunk/bigdata-sails/src/test:3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/java:2594-3237 /branches/dev-btm/bigdata/src/test:3463 /branches/dev-btm/bigdata-core/src/test/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test:3463 /branches/dev-btm/bigdata-rdf/src/test:3463 /branches/dev-btm/bigdata-sails/src/test:3463 /branches/fko/bigdata-core/src/test/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/java:3588-3645 /trunk/bigdata-core/src/test/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/test:3542 /trunk/bigdata-sails/src/test:3542 Modified: branches/bbb_cleanup/bigdata-integ/pom.xml =================================================================== --- branches/bbb_cleanup/bigdata-integ/pom.xml 2010-09-27 23:50:43 UTC (rev 3645) +++ branches/bbb_cleanup/bigdata-integ/pom.xml 2010-09-28 00:25:49 UTC (rev 3646) @@ -3,6 +3,7 @@ <groupId>com.bigdata</groupId> <artifactId>bigdata</artifactId> <version>0.83.2-SNAPSHOT</version> + <relativePath>../</relativePath> </parent> <modelVersion>4.0.0</modelVersion> Copied: branches/bbb_cleanup/bigdata-integ/src/test/resources/kill_leftover_processes.sh (from rev 3645, branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh) =================================================================== --- branches/bbb_cleanup/bigdata-integ/src/test/resources/kill_leftover_processes.sh (rev 0) +++ branches/bbb_cleanup/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-28 00:25:49 UTC (rev 3646) @@ -0,0 +1,11 @@ +#! /bin/bash +# +# Kill all instances of the java QuorumPeerMain and ServiceStarter processes. +# This is a bit dangerous in a CI environment as we might have other build in progress +# that have launched these Java processes. This should suffice for the short-term though. +# +# TODO: Make this more generic so that we can kill processes +# with other names as well. +# +kill `jps | grep QuorumPeerMain | cut -d' ' -f1 ` +kill `jps | grep ServiceStarter | cut -d' ' -f1 ` Modified: branches/bbb_cleanup/bigdata-integ/src/test/resources/services.xml =================================================================== --- branches/bbb_cleanup/bigdata-integ/src/test/resources/services.xml 2010-09-27 23:50:43 UTC (rev 3645) +++ branches/bbb_cleanup/bigdata-integ/src/test/resources/services.xml 2010-09-28 00:25:49 UTC (rev 3646) @@ -1,30 +1,10 @@ <project name="bigdata-integration-lookup-starter" default="help" basedir="."> -<!-- - <property name="integ.deploy.dir" location="${basedir}/.." /> - <property name="integ.app.home" location="${deploy.dir}" /> - <property name="integ.deploy.conf.dir" location="${deploy.dir}/conf" /> - <property name="integ.deploy.lib" location="${deploy.dir}/lib" /> - <property name="integ.deploy.lib.test" location="${deploy.dir}/testing/lib-test" /> - <property name="integ.deploy.lib.dl" location="${deploy.dir}/lib-dl" /> - <property name="integ.test.codebase.dir" location="${deploy.lib.dl}" /> - <property name="integ.test.codebase.port" value="23333" /> - <property name="integ.java.security.policy" location="conf/policy.all" /> - <property name="integ.log4j.configuration" location="${deploy.dir}/var/config/logging/log4j.properties" /> - <property name="integ.java.net.preferIPv4Stack" value="true" /> - <property name="integ.default.nic" value="eth0" /> - <property name="integ.parent.artifactName" value="bigdata-core" /> ---> - - <!-- Set to the empty string to indicate "unset". Application code will determine correct - default value. - <property name="integ.federation.name" value="" /> - --> - + <target name="help"> <echo level="error" message="This script must be run with either the 'start' or 'stop' targets" /> - <antcall target="dumpProps" /> + <antcall target="dumpProps" /> </target> - + <target name="dumpProps"> <echo message="Application properties:" /> <echo message="-----------------------" /> @@ -34,6 +14,10 @@ <target name="start"> <echo message="Starting support services..." /> + + <!-- Probably overkill, but here just in case the previous run + failed to kill the leftover processes for some reason --> + <antcall target="kill-leftover-processes" /> <antcall target="dumpProps" /> <antcall target="startHttpd" /> <antcall target="startLookup" /> @@ -44,6 +28,7 @@ <antcall target="dumpProps" /> <antcall target="stopLookup" /> <antcall target="stopHttpd" /> + <antcall target="kill-leftover-processes" /> </target> <target name="startHttpd"> @@ -97,6 +82,16 @@ </java> </target> + <!-- Some tests currently leave processes (e.g. QuorumPeerMain) hanging around after + the tests have completed. This task kills those processes (Unix-only). --> + + <target name="kill-leftover-processes"> + <echo message="Killing leftover processes" /> + <chmod file="${basedir}/kill_leftover_processes.sh" perm="777" verbose="true" /> + <exec spawn="false" resolveexecutable="true" executable="kill_leftover_processes.sh"> + </exec> + </target> + <target name="clean-sparql-test-suite" description="delete the files unpacked by the Sesame SPARQL test suite."> <echo>"clearing: ${java.io.tmpdir}/sparql-*"</echo> <delete verbose="true"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <res...@us...> - 2010-09-27 23:50:49
|
Revision: 3645 http://bigdata.svn.sourceforge.net/bigdata/?rev=3645&view=rev Author: resendes Date: 2010-09-27 23:50:43 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Next batch of updates for com.bigdata.util Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NT.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NV.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java Added Paths: ----------- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNT.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNV.java Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NT.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NT.java 2010-09-27 23:38:47 UTC (rev 3644) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NT.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -60,22 +60,18 @@ } + @Override public int hashCode() { return hashCode; } + @Override public boolean equals(Object o) { - return equals((NT) o); + if (!(o instanceof NT)) { - } - - public boolean equals(NT o) { - - if (o == null) { - /* * Note: This handles a case where the other instance was a key in a * WeakHashMap and the reference for the key was cleared. This @@ -85,14 +81,15 @@ return false; } + NT nt = (NT)o; - if (this == o) + if (this == nt) return true; - if (!this.name.equals(o.name)) + if (!this.name.equals(nt.name)) return false; - if (this.timestamp != o.timestamp) + if (this.timestamp != nt.timestamp) return false; return true; Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NV.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NV.java 2010-09-27 23:38:47 UTC (rev 3644) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NV.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -5,6 +5,8 @@ /** * A name-value pair. * + * Note: this class has a natural ordering that is inconsistent with equals. + * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ @@ -56,16 +58,20 @@ } - public int hashCode() { - - return name.hashCode(); - + @Override + public int hashCode() { + return name.hashCode(); } - public boolean equals(NV o) { - - return name.equals(o.name) && value.equals(o.value); + @Override + public boolean equals(Object o) { + if (!(o instanceof NV)) { + return false; + } + NV nv = (NV)o; + return name.equals(nv.name) && value.equals(nv.value); + } /** @@ -79,34 +85,34 @@ } - /** - * Combines the two arrays, appending the contents of the 2nd array to the - * contents of the first array. - * - * @param a - * @param b - * @return - */ - public static NV[] concat(final NV[] a, final NV[] b) { +// /** +// * Combines the two arrays, appending the contents of the 2nd array to the +// * contents of the first array. +// * +// * @param a +// * @param b +// * @return +// */ +// public static NV[] concat(final NV[] a, final NV[] b) { +// +// if (a == null && b == null) +// return a; +// +// if (a == null) +// return b; +// +// if (b == null) +// return a; +// +// final NV[] c = (NV[]) java.lang.reflect.Array.newInstance(a.getClass() +// .getComponentType(), a.length + b.length); +// +// System.arraycopy(a, 0, c, 0, a.length); +// +// System.arraycopy(b, 0, c, a.length, b.length); +// +// return c; +// +// } - if (a == null && b == null) - return a; - - if (a == null) - return b; - - if (b == null) - return a; - - final NV[] c = (NV[]) java.lang.reflect.Array.newInstance(a.getClass() - .getComponentType(), a.length + b.length); - - System.arraycopy(a, 0, c, 0, a.length); - - System.arraycopy(b, 0, c, a.length, b.length); - - return c; - - } - } Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 23:38:47 UTC (rev 3644) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -71,6 +71,8 @@ suite.addTestSuite( TestEntryUtil.class ); suite.addTestSuite( TestFormat.class ); suite.addTestSuite( TestHTMLUtility.class ); + suite.addTestSuite( TestNT.class ); + suite.addTestSuite( TestNV.class ); return suite; } Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java 2010-09-27 23:38:47 UTC (rev 3644) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -13,7 +13,6 @@ import net.jini.lookup.entry.Comment; import net.jini.lookup.entry.Location; import net.jini.lookup.entry.Name; -import net.jini.lookup.entry.ServiceType; import junit.framework.TestCase; public class TestEntryUtil extends TestCase { @@ -225,66 +224,6 @@ assertNotEquivalentSets(entries2, entries1); } - public static class MyServiceType extends ServiceType { - private static final long serialVersionUID = 1L; - //Only public, non-transient/final/static are used for Entry objs - public String name = null; - public String desc = null; - - public MyServiceType() {} //default cons per spec - - public MyServiceType(String name, String desc) { - super(); - this.name = name; - this.desc = desc; - } - - @Override - public String getDisplayName() { - return name; - } - - @Override - public String getShortDescription() { - return desc; - } - } - - public void testCompareEntrySets_equiv_serviceType() { - Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; - Entry[] entries2 = new Entry[] {new MyServiceType("A", "B")}; - assertEquivalentSets(entries1, entries2); - assertEquivalentSets(entries2, entries1); - } - - public void testCompareEntrySets_unequiv_serviceType() { - Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; - Entry[] entries2 = new Entry[] {new MyServiceType("A", "C")}; - assertNotEquivalentSets(entries1, entries2); - assertNotEquivalentSets(entries2, entries1); - } - - public void testCompareEntrySets_unequiv_serviceType2() { - Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; - Entry[] entries2 = new Entry[] {new MyServiceType("D", "B")}; - assertNotEquivalentSets(entries1, entries2); - assertNotEquivalentSets(entries2, entries1); - } - - public void testCompareEntrySets_unequiv_serviceType_null1() { - Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; - Entry[] entries2 = new Entry[] {new MyServiceType(null, "B")}; - assertNotEquivalentSets(entries1, entries2); - assertNotEquivalentSets(entries2, entries1); - } - - public void testCompareEntrySets_unequiv_serviceType_null2() { - Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; - Entry[] entries2 = new Entry[] {new MyServiceType("A", null)}; - assertNotEquivalentSets(entries1, entries2); - assertNotEquivalentSets(entries2, entries1); - } - private static class MyEntryWithUnusableFields extends AbstractEntry { private static final long serialVersionUID = 1L; // final, static, excluded public final String finalString = "finalString"; // final, excluded Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNT.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNT.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNT.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -0,0 +1,76 @@ +package com.bigdata.util; + +import com.bigdata.util.CSVReader.Header; + +import junit.framework.TestCase; + +public class TestNT extends TestCase { + + + public void testGetName() { + String name = "ABC"; + NT nt = new NT(name, 1L); + assertEquals(name, nt.getName()); + } + + public void testGetTimestamp() { + long time = 1L; + NT nt = new NT("ABC", time); + assertEquals(time, nt.getTimestamp()); + } + + public void testNT_null() { + try { + NT nt = new NT(null, 1L); + fail("Sucessfully called NT with a null name argument."); + } catch (IllegalArgumentException e) { + // ignore -- expected + } + } + + public void testEqualsObject() { + String name = "abc"; + long time = 1L; + NT h = new NT(name, time); + NT h_dup = new NT(name, time); + NT h_dup2 = new NT(name, time); + NT h_diff = new NT(name + "diff", time); + NT h_diff2 = new NT(name, (time + 1L)); + + // Test reflexive property + assertTrue(h.equals(h)); + + // Test symmetric property + assertTrue(h.equals(h_dup) && h_dup.equals(h)); + + //Test transitive property + assertTrue(h.equals(h_dup) && h_dup.equals(h_dup2) && h.equals(h_dup2)); + + // consistency property already tested + + // Test negative cases + assertFalse(h.equals(null)); + + assertFalse(h.equals(name)); + + assertFalse(h.equals(h_diff)); + assertFalse(h.equals(h_diff2)); + } + + public void test_hashcode() { + String name = "abc"; + long time = 1L; + NT h = new NT(name, time); + NT h_dup = new NT(name, time); + assertTrue(h.hashCode()==h_dup.hashCode()); + } + + public void test_toString() { + String name = "abc"; + long time = 1L; + NT h = new NT(name, time); + NT h_dup = new NT(name, time); + assertTrue(h.toString().equals("NT{name=" + "abc" + ",timestamp=" + 1L + "}")); + } + +} Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNV.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNV.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNV.java 2010-09-27 23:50:43 UTC (rev 3645) @@ -0,0 +1,102 @@ +package com.bigdata.util; + +import junit.framework.TestCase; + +public class TestNV extends TestCase { + + + public void testGetName() { + String name = "ABC"; + NV nt = new NV(name, name); + assertEquals(name, nt.getName()); + } + + public void testGetValue() { + String name = "ABC"; + NV nt = new NV(name, name); + assertEquals(name, nt.getValue()); + } + + public void testNV_null() { + try { + new NV(null, "abc"); + fail("Successfully called NV() with null name argument."); + } catch (IllegalArgumentException e) { + //ignore -- expected + } + } + + public void testToString() { + String name = "Name"; + String value = "Value"; + NV nv = new NV(name, value); + assertTrue((name+"="+value).equals(nv.toString())); + } + + public void testEqualsNV() { + + String name = "abc"; + String value = "xyz"; + NV h = new NV(name, value); + NV h_dup = new NV(name, value); + NV h_dup2 = new NV(name, value); + NV h_diff = new NV(name + "diff", value); + NV h_diff2 = new NV(name, (value + "diff")); + + // Test reflexive property + assertTrue(h.equals(h)); + + // Test symmetric property + assertTrue(h.equals(h_dup) && h_dup.equals(h)); + + //Test transitive property + assertTrue(h.equals(h_dup) && h_dup.equals(h_dup2) && h.equals(h_dup2)); + + // consistency property already tested + + // Test negative cases + assertFalse(h.equals(null)); + + assertFalse(h.equals(name)); + + assertFalse(h.equals(h_diff)); + assertFalse(h.equals(h_diff2)); + } + + public void testHashCode() { + String name = "abc"; + String value = "xyz"; + NV h = new NV(name, value); + NV h_dup = new NV(name, value); + assertTrue(h.hashCode()==h_dup.hashCode()); + } + + public void testCompareTo() { + String name = "bcd"; + String value = "xyz"; + String lessThanName = "abc"; + String greaterThanName = "cde"; + NV nv = new NV(name, value); + NV ltnv = new NV(lessThanName, value); + NV gtnv = new NV(greaterThanName, value); + assertTrue(nv.compareTo(nv) == 0); + assertTrue(ltnv.compareTo(nv) < 0); + assertTrue(gtnv.compareTo(nv) > 0); + } + + public void testCompareContract() { + /* + * The NV class has a natural ordering that is inconsistent with equals. + * When equals and compare align, need to switch this test and the note, above, + * in the NV source code. + */ + String name = "bcd"; + String value1 = "xyz"; + String value2 = "lmn"; + NV nv = new NV(name, value1); + NV nv_diff_val = new NV(name, value2); + assertFalse(nv.equals(nv_diff_val)); + assertTrue(nv.compareTo(nv_diff_val)==0); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-27 23:38:55
|
Revision: 3644 http://bigdata.svn.sourceforge.net/bigdata/?rev=3644&view=rev Author: thompsonbry Date: 2010-09-27 23:38:47 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Hand off to Martyn on the striterators. This commit DOES NOT include the class path changes. DO NOT commit them until we have this all worked out or we will break the build. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/UniquenessFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitor.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitorator.java Added Paths: ----------- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/FilterBase.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IPropertySet.java Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -33,7 +33,7 @@ * Used with Appenderator by Striterator to filter returned objects. */ -public class Appender implements IFilter { +public class Appender extends FilterBase { protected Iterator m_xtra = null; public Appender() {} @@ -44,8 +44,9 @@ //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Appenderator(src, (Iterator) m_xtra); + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Appenderator(src, context, (Iterator) m_xtra); } //------------------------------------------------------------- Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -33,13 +33,15 @@ public class Appenderator implements Iterator { - Iterator m_src; - Iterator m_xtra; + private final Iterator m_src; + protected final Object m_ctx; + private final Iterator m_xtra; - Iterator m_current; + private Iterator m_current; - public Appenderator(Iterator src, Iterator xtra) { + public Appenderator(Iterator src, Object ctx, Iterator xtra) { m_src = src; + m_ctx = ctx; m_xtra = xtra; m_current = m_src; Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -31,9 +31,17 @@ * Used with a Contractorator to contract an Expanded iterator * * The Contractorator will call contract on this object + * * @author Martyn Cutcher + * + * @todo CONTRACTOR annotation and allow it to be set as an argument, moving + * contract() onto the contractorator. + * + * @todo CONTRACTOR should be able to break an iterator into many chunks, not + * just one. Maybe the API should return an Iterator from an Iterator + * in which the chunkiness is changed? */ -public abstract class Contractor implements IFilter { +public abstract class Contractor extends FilterBase { protected Object m_state = null; @@ -45,8 +53,9 @@ //------------------------------------------------------------- - public Iterator filter(Iterator src) { - return new Contractorator(src, this); + @Override + public Iterator filterOnce(Iterator src, Object context) { + return new Contractorator(src, context, this); } //------------------------------------------------------------- Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -43,12 +43,14 @@ * @author Martyn Cutcher */ public class Contractorator implements Iterator { - Iterator m_src; - Contractor m_contractor; - Object m_next; + private final Iterator m_src; + protected final Object m_ctx; + private final Contractor m_contractor; + private Object m_next; - public Contractorator(Iterator src, Contractor contractor) { + public Contractorator(Iterator src, final Object ctx, Contractor contractor) { m_src = src; + m_ctx = ctx; m_contractor = contractor; m_next = m_contractor.contract(m_src); Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -35,22 +35,22 @@ * Derivations must implement expand method. */ -public abstract class Expander implements IFilter { - protected Object m_state = null; +public abstract class Expander extends FilterBase { public Expander() { } public Expander(Object state) { - m_state = state; + super(state); } //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Expanderator(src, this); - } + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Expanderator(src, context, this); + } - //------------------------------------------------------------- + // ------------------------------------------------------------- - protected abstract Iterator expand(Object obj); + protected abstract Iterator expand(Object obj); } \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -39,13 +39,14 @@ public class Expanderator implements Iterator { - Iterator m_src; - Iterator m_child = null; + private final Iterator m_src; + private Iterator m_child = null; + protected final Object m_context; + private final Expander m_expander; - Expander m_expander; - - public Expanderator(Iterator src, Expander expander) { + public Expanderator(Iterator src, Object context, Expander expander) { m_src = src; + m_context = context; m_expander = expander; } Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -28,25 +28,30 @@ import java.util.Iterator; /** - * Used with Filterator by Striterator to filter returned objects. + * Used with Filterator by Striterator to filter returned objects. This can + * represent either a single {@link IFilter} or a chain of {@link IFilter}s. */ -public abstract class Filter implements IFilter { +public abstract class Filter extends FilterBase { - protected Object m_state = null; - + /** + * + */ + private static final long serialVersionUID = 7584586850408369853L; + public Filter() {} public Filter(Object state) { - m_state = state; + super(state); } //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Filterator(src, this); - } + @Override + protected Iterator filterOnce(Iterator src, final Object context) { + return new Filterator(src, context, this); + } - //------------------------------------------------------------- + // ------------------------------------------------------------- - protected abstract boolean isValid(Object obj); + protected abstract boolean isValid(Object obj); } Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/FilterBase.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/FilterBase.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/FilterBase.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -0,0 +1,222 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * Used with Filterator by Striterator to filter returned objects. This can + * represent either a single {@link IFilter} or a chain of {@link IFilter}s. + */ +public abstract class FilterBase implements IFilter, Cloneable { + + private static final long serialVersionUID = 1L; + + /** + * An optional filter chain. When non-<code>null</code> this contains the + * {@link IFilter} in the same order in which they were added to this + * {@link IFilter}, but <i>this</i> is NOT included in the filter chain. + * <p> + * Note: package private for unit tests. + */ + /*private*/ volatile List<IFilter> filterChain = null; + + /** + * Annotations may be used to decorate the {@link IFilter} with required or + * optional metadata. + * <p> + * Note: package private for unit tests. + */ + /*private*/ volatile Map<String, Object> annotations; + + /** + * State from the constructor (optional). + * <p> + * Note: Striterators should not have a side-effect on state object since + * that can have unexpected consequences if the {@link IFilter} is reused. + */ + final protected Object m_state; + + public FilterBase() { + m_state = null; + } + + /** + * + * @param state + * State (optional). + */ + public FilterBase(final Object state) { + m_state = state; + } + +// public FilterBase clone() { +// +// final FilterBase inst = new FilterBase(m_state); +// +// for(IFilter filter : filterChain) { +// +// inst.addFilter(filter); +// +// } +// +// return inst; +// +// } + + /** + * Add a filter to the end of this filter chain. + * + * @param filter + * The filter. + * + * @return This filter. + */ + final public FilterBase addFilter(final IFilter filter) { + if (filter == null) + throw new IllegalArgumentException(); + if (filterChain == null) { + synchronized (this) { + /* + * Note: double-checked locking pattern and volatile field are + * used to ensure visibility in combination with lazy create of + * the backing list. + */ + if (filterChain == null) { + filterChain = Collections + .synchronizedList(new LinkedList<IFilter>()); + } + } + } + filterChain.add(filter); + + return this; + } + + final public Iterator filter(Iterator src, final Object context) { + // wrap src with _this_ filter. + src = filterOnce(src, context); + if (filterChain != null) { + // wrap source with each additional filter from the filter chain. + for (IFilter filter : filterChain) { + src = filter.filter(src, context); + } + } + return src; + } + + /** + * Wrap the source iterator with <i>this</i> filter. + * + * @param src + * The source iterator. + * @param context + * The iterator evaluation context. + * + * @return The wrapped iterator. + */ + abstract protected Iterator filterOnce(Iterator src, final Object context); + + final public Object getProperty(String name) { + + if (annotations == null) + return null; + + return annotations.get(name); + + } + + /** + * Return the value of a named property. + * + * @param name + * The property name. + * + * @return The property value. + * + * @throws IllegalStateException + * unless the named property is bound. + */ + final protected Object getRequiredProperty(final String name) { + + final Object value = getProperty(name); + + if (value == null) + throw new IllegalStateException(name); + + return value; + + } + + /** + * Set an annotation. + * + * @param name + * The name. + * @param value + * The value. + * + * @return The old value. + */ + final public Object setProperty(final String name, final Object value) { + + if (name == null) + throw new IllegalArgumentException(); + + if (annotations == null) { + /* + * Note: double-checked locking pattern and volatile field are used + * to ensure visibility in combination with lazy create of the + * annotations map. + */ + synchronized (this) { + if (annotations == null) { + annotations = Collections + .synchronizedMap(new LinkedHashMap<String, Object>()); + } + } + } + return annotations.put(name, value); + } + + /** + * Human readable representation of the filter chain. + */ + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.append("{annotations=" + annotations); + sb.append(",filterChain=" + filterChain); + sb.append("}"); + return sb.toString(); + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/FilterBase.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -42,13 +42,15 @@ public class Filterator implements Iterator { - Iterator m_src; - Object m_value = null; + private Iterator m_src; + private Object m_value = null; - protected Filter m_filter = null; + final protected Object m_context; + final protected Filter m_filter; - public Filterator(Iterator src, Filter filter) { + public Filterator(final Iterator src, final Object context, final Filter filter) { m_src = src; + m_context = context; m_filter = filter; m_value = getNext(); Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -32,16 +32,20 @@ /** * Provides the hook interface that allows use by Striterators */ -public interface IFilter extends Serializable { +public interface IFilter extends Serializable, IPropertySet { /** * <p>The filter method is provided to allow the creation of the filtering iterator.</p> * * <p>Any implementation should follow the following pattern:</p> * <pre> - * public Iterator filter(Iterator src) { - * return new Filterator(src, this); + * public Iterator filter(Iterator src, Object context) { + * return new Filterator(src, context, this); * } * </pre> + * This pattern makes the source iterator, the evaluation context, and the + * {@link IPropertySet} annotations visible to the runtime striterator + * implementation. **/ - public abstract Iterator filter(Iterator src); + public abstract Iterator filter(Iterator src, Object context); + } \ No newline at end of file Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IPropertySet.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IPropertySet.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IPropertySet.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -0,0 +1,47 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 27, 2010 + */ + +package cutthecrap.utils.striterators; + +/** + * Interface for access to named property values. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + */ +public interface IPropertySet { + + /** + * Return the value of a named property. + * + * @param name + * The property name. + * + * @return The property value. + */ + Object getProperty(String name); + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IPropertySet.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -25,8 +25,8 @@ package cutthecrap.utils.striterators; +import java.lang.reflect.Method; import java.util.Iterator; -import java.lang.reflect.Method; /** * Mapper @@ -34,9 +34,9 @@ * Used with Mapperator by Striterator to map instance methods against member objects. */ -public class Mapper implements IFilter { +public class Mapper extends FilterBase { protected Object m_client = null; - protected Method m_method = null; + protected Method m_method = null; // @todo Not serializable. Defer reflection? protected Object[] m_args = {null}; public Mapper(Object client, Method method) { @@ -46,9 +46,10 @@ //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Mapperator(src, this); - } + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Mapperator(src, context, this); + } //------------------------------------------------------------- Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -35,11 +35,13 @@ public class Mapperator implements Iterator { - Iterator m_iter; - Mapper m_mapper; + final private Iterator m_iter; + final protected Object m_context; + final private Mapper m_mapper; - public Mapperator(Iterator iter, Mapper mapper) { + public Mapperator(Iterator iter, Object context, Mapper mapper) { m_iter = iter; + m_context = context; m_mapper = mapper; } Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -32,8 +32,9 @@ * Used with Mergerator by Striterator to merge returned objects. */ -public class Merger implements IFilter { - protected Iterator m_xtra = null; +public class Merger extends FilterBase { + + protected Iterator m_xtra = null; // @todo Non-Serializable. protected Comparator m_comparator = null; public Merger() {} @@ -45,8 +46,9 @@ //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Mergerator(src, m_xtra, m_comparator); + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Mergerator(src, m_xtra, context, m_comparator); } //------------------------------------------------------------- Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -33,14 +33,16 @@ **/ public class Mergerator implements Iterator { - Iterator m_setA; - Iterator m_setB; - Comparator m_comparator; + final private Iterator m_setA; + final private Iterator m_setB; + final protected Object m_context; + final private Comparator m_comparator; - Object m_valA = null; - Object m_valB = null; + private Object m_valA = null; + private Object m_valB = null; - public Mergerator(Iterator setA, Iterator setB, Comparator comparator) { + public Mergerator(Iterator setA, Iterator setB, Object context, Comparator comparator) { + m_context = context; m_setA = setA; m_setB = setB; Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -35,19 +35,19 @@ * Cannot be instantiated directly since an implementation of the resolve method is required. */ -public abstract class Resolver implements IFilter { - protected Object m_state = null; +public abstract class Resolver extends FilterBase { public Resolver() {} public Resolver(Object state) { - m_state = state; + super(state); } //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Resolverator(src, this); + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Resolverator(src, context, this); } //------------------------------------------------------------- Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -35,11 +35,13 @@ public class Resolverator implements Iterator { - Iterator m_iter; - Resolver m_resolver; + private final Iterator m_iter; + protected final Object m_context; + private final Resolver m_resolver; - public Resolverator(Iterator iter, Resolver resolver) { + public Resolverator(Iterator iter, Object context, Resolver resolver) { m_iter = iter; + m_context = context; m_resolver = resolver; } Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorter.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorter.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -25,7 +25,8 @@ package cutthecrap.utils.striterators; -import java.util.*; +import java.util.Comparator; +import java.util.Iterator; /** * <p>Used with Sorterator by Striterator to sort iterations.</p> @@ -37,17 +38,40 @@ * for sets that may be very large.</p> */ -public abstract class Sorter implements IFilter, Comparator { - public Sorter() { - } - - //------------------------------------------------------------- +abstract public class Sorter extends FilterBase implements Comparator { + +// /** +// * Annotation giving the {@link Comparator} to be applied. +// */ +// static final public String COMPARATOR = Sorter.class.getName() +// + ".comparator"; - final public Iterator filter(Iterator src) { - return new Sorterator(src, this); - } + public Sorter() { + } - //------------------------------------------------------------- +// public Sorter(Comparator c) { +// +// setProperty(COMPARATOR, c); +// +// } - public abstract int compare(Object o1, Object o2); -} \ No newline at end of file + // ------------------------------------------------------------- + + @Override + final public Iterator filterOnce(Iterator src, Object context) { + + return new Sorterator(src, context, this); + + } + + // ------------------------------------------------------------- + +// public Comparator getComparator() { +// +// return (Comparator) getRequiredProperty(COMPARATOR); +// +// } + + public abstract int compare(Object o1, Object o2); + +} Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorterator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorterator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -33,18 +33,36 @@ public class Sorterator implements Iterator { - Iterator m_iter; + private final Iterator m_iter; + protected final Object m_context; - public Sorterator(Iterator iter, Sorter sorter) { - TreeSet set = new TreeSet(sorter); - - while (iter.hasNext()) { - set.add(iter.next()); - } - - m_iter = set.iterator(); - } + public Sorterator(Iterator iter, Object context, Sorter sorter) { + this.m_context = context; + + // materialize the objects to be sorted. + LinkedList tmp = new LinkedList(); + + while(iter.hasNext()) { + tmp.add(iter.next()); + } + + Object[] a = tmp.toArray(); + + Arrays.sort(a, sorter/*.getComparator()*/); + + m_iter = Arrays.asList(a).iterator(); + +// TreeSet set = new TreeSet(sorter); +// +// while (iter.hasNext()) { +// set.add(iter.next()); +// } +// +// m_iter = set.iterator(); + + } + public boolean hasNext() { return m_iter.hasNext(); } Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -25,9 +25,10 @@ package cutthecrap.utils.striterators; +import java.lang.reflect.Method; +import java.util.Enumeration; import java.util.Iterator; -import java.util.Enumeration; -import java.lang.reflect.Method; +import java.util.List; /** * Striterator @@ -38,25 +39,47 @@ * The <code>addTypeFilter</code> method allows easy specification of a class type restriction. */ public class Striterator implements IStriterator { - Iterator m_src = null; + private List<IFilter> filters = null; // Note: NOT serializable. + private transient Iterator realSource; + private transient Iterator m_src = null; - /** Constructor takes source iterator **/ - public Striterator(Iterator src) { - m_src = src; - } + /** + * Deserialization constructor. + */ + public Striterator() { + this.realSource = null; + } - public Striterator(Enumeration src) { - this(new EnumIterator(src)); - } + /** Constructor takes source iterator **/ + public Striterator(final Iterator src) { + this.realSource = src; + } - /** delegates hasNext request to source iterator **/ - public boolean hasNext() { - return m_src.hasNext(); - } + public Striterator(final Enumeration src) { + this(new EnumIterator(src)); + } - /** delegates next request to source iterator **/ - public Object next() { - return m_src.next(); + /** + * + * @param src + * @param filter + */ + public Striterator(final Iterator src, final List<IFilter> filters) { + this.realSource = src; + } + + /** delegates hasNext request to source iterator **/ + public boolean hasNext() { + if (m_src == null) + compile(realSource); + return m_src.hasNext(); + } + + /** delegates next request to source iterator **/ + public Object next() { + if (m_src == null) + compile(realSource); + return m_src.next(); } /** Enumeration version of hasNext() **/ @@ -75,12 +98,27 @@ } /** creates a Filterator to apply the filter **/ - public IStriterator addFilter(IFilter filter) { - m_src = filter.filter(m_src); - - return this; + public IStriterator addFilter(final IFilter filter) { + if (filters != null) + filters.add(filter); + + return this; } + public void compile(final Iterator src) { + compile(src, null/* context */); + } + + public void compile(final Iterator src, final Object context) { + if (m_src != null) + throw new IllegalStateException(); + m_src = realSource = src; + if (filters != null) + for (IFilter filter : filters) { + m_src = filter.filter(m_src, context); + } + } + /** check each object against cls.isInstance(object) **/ public IStriterator addTypeFilter(Class cls) { addFilter(new Filter(cls) { Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/UniquenessFilter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/UniquenessFilter.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/UniquenessFilter.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -25,7 +25,7 @@ package cutthecrap.utils.striterators; -import java.util.*; +import java.util.LinkedHashSet; /****************************************************************************** * UniquenessFilter @@ -33,7 +33,10 @@ * Derived from Filter, and ensures no duplication, not to be used with large sets! */ public class UniquenessFilter extends Filter { - ArrayList m_members = new ArrayList(); + + private static final long serialVersionUID = 424197241022124358L; +// ArrayList m_members = new ArrayList(); + private final LinkedHashSet<Object> m_members = new LinkedHashSet<Object>(); public UniquenessFilter() { super(null); @@ -43,11 +46,12 @@ * Just make sure that the current object has not already been returned **/ protected boolean isValid(Object obj) { - if (m_members.contains(obj)) { - return false; - } - m_members.add(obj); - - return true; + return m_members.add(obj); +// if (m_members.contains(obj)) { +// return false; +// } +// m_members.add(obj); +// +// return true; } } Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitor.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitor.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitor.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -25,17 +25,18 @@ package cutthecrap.utils.striterators; -import java.util.*; +import java.util.Iterator; /** * @author Martyn Cutcher */ -public abstract class Visitor implements IFilter { +public abstract class Visitor extends FilterBase { //------------------------------------------------------------- - final public Iterator filter(Iterator src) { - return new Visitorator(src, this); + @Override + final public Iterator filterOnce(Iterator src, Object context) { + return new Visitorator(src, context, this); } protected abstract void visit(Object obj); Modified: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitorator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitorator.java 2010-09-27 23:33:28 UTC (rev 3643) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitorator.java 2010-09-27 23:38:47 UTC (rev 3644) @@ -32,11 +32,13 @@ */ public class Visitorator implements Iterator { - Iterator m_iter; - Visitor m_visitor; + private final Iterator m_iter; + protected final Object m_context; + private final Visitor m_visitor; - public Visitorator(Iterator iter, Visitor visitor) { + public Visitorator(Iterator iter, Object context, Visitor visitor) { m_iter = iter; + m_context = context; m_visitor = visitor; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-27 23:33:34
|
Revision: 3643 http://bigdata.svn.sourceforge.net/bigdata/?rev=3643&view=rev Author: thompsonbry Date: 2010-09-27 23:33:28 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Hand off to Martyn on the striterators. This commit DOES NOT include the class path changes. DO NOT commit them until we have this all worked out or we will break the build. Added Paths: ----------- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestAll.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilterBase.java Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestAll.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestAll.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestAll.java 2010-09-27 23:33:28 UTC (rev 3643) @@ -0,0 +1,95 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 27, 2010 + */ + +package cutthecrap.utils.striterators; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public class TestAll extends TestCase { + + /** + * + */ + public TestAll() { + } + + /** + * @param arg0 + */ + public TestAll(String arg0) { + super(arg0); + } + + /** + * Aggregates the tests in increasing dependency order. + */ + public static Test suite() + { + + final TestSuite suite = new TestSuite("striterators"); + + suite.addTestSuite(TestFilterBase.class); + + /* + * @todo test Appender + * + * @todo test Contractor + * + * @todo test ExclusionFilter + * + * @todo test Expander + * + * @todo test Mapper + * + * @todo Test Merger + * + * @todo Test Resolver + * + * @todo Test Sorter + * + * @todo Test UniquenessFilter + * + * @todo Test Visitor + * + * @todo Test XProperty + * + */ + suite.addTestSuite(TestFilter.class); + + // @todo test Striterator + + return suite; + + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestAll.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilter.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilter.java 2010-09-27 23:33:28 UTC (rev 3643) @@ -0,0 +1,53 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 27, 2010 + */ + +package cutthecrap.utils.striterators; + +import junit.framework.TestCase; + +/** + * Test suite for {@link Filter}. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public class TestFilter extends TestCase { + + /** + * + */ + public TestFilter() { + } + + /** + * @param name + */ + public TestFilter(String name) { + super(name); + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilter.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilterBase.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilterBase.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilterBase.java 2010-09-27 23:33:28 UTC (rev 3643) @@ -0,0 +1,235 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 27, 2010 + */ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +import junit.framework.TestCase; + +/** + * Test suite for {@link FilterBase}. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public class TestFilterBase extends TestCase { + + /** + * + */ + public TestFilterBase() { + } + + /** + * @param name + */ + public TestFilterBase(String name) { + super(name); + } + + public void test_filterBase_ctor() { + + final FilterBase fixture = new MockFilterBase(); + + assertEquals("state", null, fixture.m_state); + assertEquals("annotations", null, fixture.annotations); + assertEquals("filterChain", null, fixture.filterChain); + + } + + public void test_filterBase_ctor2() { + + final Object state = new Object(); + + final FilterBase fixture = new MockFilterBase(state); + + assertEquals("state", state, fixture.m_state); + assertEquals("annotations", null, fixture.annotations); + assertEquals("filterChain", null, fixture.filterChain); + + } + + public void test_filterBase_annotations() { + + final FilterBase fixture = new MockFilterBase(); + + assertEquals("annotations", null, fixture.annotations); + + final String name = "name"; + final Object value = Integer.valueOf(0); + final Object value2 = Integer.valueOf(1); + + try { + fixture.getRequiredProperty(name); + fail("Expecting: " + IllegalStateException.class); + } catch (IllegalStateException ex) { + + } + + assertNull(fixture.getProperty(name)); + assertNull(fixture.setProperty(name, value)); + assertNotNull("annotations", fixture.annotations); + assertEquals("annotations", 1, fixture.annotations.size()); + assertEquals(value, fixture.getProperty(name)); + assertEquals(value, fixture.getRequiredProperty(name)); + assertEquals(value, fixture.setProperty(name, value2)); + assertEquals(value2, fixture.getProperty(name)); + assertEquals(value2, fixture.getRequiredProperty(name)); + + } + + public void test_filterBase_filterChain() { + + final Object s1 = "s1"; + final Object s2 = "s2"; + final Object s3 = "s3"; + + final FilterBase f1, f2, f3; + + final FilterBase fixture = f1 = new MockFilterBase(s1); + + assertNull("filterChain", fixture.filterChain); + + fixture.addFilter(f2 = new MockFilterBase(s2)); + + assertNotNull("filterChain", fixture.filterChain); + + fixture.addFilter(f3 = new MockFilterBase(s3)); + + final IFilter[] expected = new IFilter[] { f2, f3 }; + + final IFilter[] actual = f1.filterChain.toArray(new IFilter[] {}); + + assertEquals("#filters", expected.length, actual.length); + + for (int i = 0; i < expected.length; i++) { + + assertEquals("filter[" + i + "]", expected[i], actual[i]); + + } + + } + + /** + * Test creation of iterator without filter chain. make sure that the + * context is passed through. + */ + public void test_filter() { + + final FilterBase fixture = new MockFilterBase(); + + final Object context = new Object(); + + final Iterator src = EmptyIterator.DEFAULT; + + final MockIterator actual = (MockIterator) fixture.filter(src, context); + + assertNotNull(actual); + assertTrue("src", actual.src == src); + assertTrue("context", actual.context == context); + + } + + /** + * Test creation of iterator with filter chain. Make sure that the create + * order is correct and that the context is passed through to each iterator. + * The iterators are assembled in FIFO order, so the iterator stack winds up + * being LIFO. + */ + public void test_filter2() { + + final FilterBase fixture = new MockFilterBase(); + final FilterBase fixture2 = new MockFilterBase(); + final FilterBase fixture3 = new MockFilterBase(); + + final Object context = new Object(); + + final Iterator src = EmptyIterator.DEFAULT; + + final MockIterator actual = (MockIterator) fixture.filter(src, context); + +// assertNotNull(actual); +// assertTrue("src", actual.src == src); +// assertTrue("context", actual.context == context); + + fail("write test"); + } + + /** + * Mock object. + */ + private static class MockFilterBase extends FilterBase { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public MockFilterBase() { + super(); + } + + public MockFilterBase(Object o) { + super(o); + } + + @Override + protected Iterator filterOnce(Iterator src, Object context) { + return new MockIterator(src, context); + } + + } + + private static class MockIterator<E> implements Iterator<E> { + + final Iterator src; + + final Object context; + + public MockIterator(Iterator src,Object context) { + + this.src = src; + + this.context = context; + + } + + public boolean hasNext() { + return false; + } + + public E next() { + return null; + } + + public void remove() { + } + + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/test/cutthecrap/utils/striterators/TestFilterBase.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-27 20:12:13
|
Revision: 3642 http://bigdata.svn.sourceforge.net/bigdata/?rev=3642&view=rev Author: blevine218 Date: 2010-09-27 20:12:07 +0000 (Mon, 27 Sep 2010) Log Message: ----------- add ServiceStarter to the list of Java processes that might be left over and should be forcibly killed. Modified Paths: -------------- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml Modified: branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh =================================================================== --- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-27 20:01:43 UTC (rev 3641) +++ branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-27 20:12:07 UTC (rev 3642) @@ -1,7 +1,11 @@ #! /bin/bash # -# Kill all instances of the java QuorumPeerMain process +# Kill all instances of the java QuorumPeerMain and ServiceStarter processes. +# This is a bit dangerous in a CI environment as we might have other build in progress +# that have launched these Java processes. This should suffice for the short-term though. +# # TODO: Make this more generic so that we can kill processes -# with other names as well +# with other names as well. # kill `jps | grep QuorumPeerMain | cut -d' ' -f1 ` +kill `jps | grep ServiceStarter | cut -d' ' -f1 ` Modified: branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml =================================================================== --- branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml 2010-09-27 20:01:43 UTC (rev 3641) +++ branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml 2010-09-27 20:12:07 UTC (rev 3642) @@ -14,6 +14,10 @@ <target name="start"> <echo message="Starting support services..." /> + + <!-- Probably overkill, but here just in case the previous run + failed to kill the leftover processes for some reason --> + <antcall target="kill-leftover-processes" /> <antcall target="dumpProps" /> <antcall target="startHttpd" /> <antcall target="startLookup" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-27 20:01:49
|
Revision: 3641 http://bigdata.svn.sourceforge.net/bigdata/?rev=3641&view=rev Author: blevine218 Date: 2010-09-27 20:01:43 +0000 (Mon, 27 Sep 2010) Log Message: ----------- minor comment update Modified Paths: -------------- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh Modified: branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh =================================================================== --- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-27 18:53:19 UTC (rev 3640) +++ branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-27 20:01:43 UTC (rev 3641) @@ -1,2 +1,7 @@ #! /bin/bash +# +# Kill all instances of the java QuorumPeerMain process +# TODO: Make this more generic so that we can kill processes +# with other names as well +# kill `jps | grep QuorumPeerMain | cut -d' ' -f1 ` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <res...@us...> - 2010-09-27 18:53:26
|
Revision: 3640 http://bigdata.svn.sourceforge.net/bigdata/?rev=3640&view=rev Author: resendes Date: 2010-09-27 18:53:19 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Next batch of changes for com.bigdata.util package Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/Format.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HTMLUtility.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/InnerCause.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/MillisecondTimestampFactory.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestInnerCause.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestMillisecondTimestampFactory.java Added Paths: ----------- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestFormat.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHTMLUtility.java Removed Paths: ------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HybridTimestampFactory.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NanosecondTimestampFactory.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHybridTimestampFactory.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNanosecondTimestampFactory.java Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/Format.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/Format.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/Format.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -36,6 +36,7 @@ * the logger; which occurs only when the log level satisfies the * necessary criteria for the message to be logged. */ +//TODO - replace references with log level checks intstead public class Format { private final String pattern; Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HTMLUtility.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HTMLUtility.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HTMLUtility.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -33,13 +33,6 @@ public class HTMLUtility { /** - * - */ - public HTMLUtility() { - super(); - } - - /** * <p> * Sometimes you want to escape something without using a DOM instance. This * method escapes a String value so that it may be written as the value of @@ -145,120 +138,120 @@ // return new String(retval.getBytes(enc), enc); // } - public static String escapeForXMLName(String s) { +// public static String escapeForXMLName(String s) { +// +// if( s == null ) { +// +// throw new IllegalArgumentException(); +// +// } +// +// int len = s.length(); +// +// if (len == 0) +// return s; +// +// StringBuffer sb = new StringBuffer(len + 20); +// +// char ch = s.charAt(0); +// +// if(Character.isDigit(ch)) +// { +// sb.append("_num_"); +// } +// +// for (int i = 0; i < len; i++) { +// +// ch = s.charAt(i); +// +// switch (ch) { +// +// case '"': +// sb.append("_quote_"); +// break; +// +// case '\'': +// sb.append("_apos_"); +// break; +// +// case '&': +// sb.append("_amp_"); +// break; +// +// case '<': +// sb.append("_lt_"); +// break; +// +// case '>': +// sb.append("_gt_"); +// break; +// +// case '$': +// sb.append("_dollar_"); +// break; +// +// case ':': +// sb.append("_colon_"); +// break; +// +// case '~': +// sb.append("_tilda_"); +// break; +// +// case '(': +// sb.append("_lparen_"); +// break; +// +// case ')': +// sb.append("_rparen_"); +// break; +// +// case ',': +// sb.append("_comma_"); +// break; +// +// case '=': +// sb.append("_eq_"); +// break; +// +// case '!': +// sb.append("_bang_"); +// break; +// +// case '?': +// sb.append("_quest_"); +// break; +// +// case '/': +// sb.append("_fw_slash_"); +// break; +// +// case '\\': +// sb.append("_bk_slash_"); +// break; +// +// case ';': +// sb.append("_semicolon_"); +// break; +// +// case '.': +// sb.append("_period_"); +// break; +// +// case '`': +// sb.append("_tic_"); +// break; +// +// default: +// sb.append(ch); +// break; +// +// } +// +// } +// +// return sb.toString(); +// +// } - if( s == null ) { - - throw new IllegalArgumentException(); - - } - - int len = s.length(); - - if (len == 0) - return s; - - StringBuffer sb = new StringBuffer(len + 20); - - char ch = s.charAt(0); - - if(Character.isDigit(ch)) - { - sb.append("_num_"); - } - - for (int i = 0; i < len; i++) { - - ch = s.charAt(i); - - switch (ch) { - - case '"': - sb.append("_quote_"); - break; - - case '\'': - sb.append("_apos_"); - break; - - case '&': - sb.append("_amp_"); - break; - - case '<': - sb.append("_lt_"); - break; - - case '>': - sb.append("_gt_"); - break; - - case '$': - sb.append("_dollar_"); - break; - - case ':': - sb.append("_colon_"); - break; - - case '~': - sb.append("_tilda_"); - break; - - case '(': - sb.append("_lparen_"); - break; - - case ')': - sb.append("_rparen_"); - break; - - case ',': - sb.append("_comma_"); - break; - - case '=': - sb.append("_eq_"); - break; - - case '!': - sb.append("_bang_"); - break; - - case '?': - sb.append("_quest_"); - break; - - case '/': - sb.append("_fw_slash_"); - break; - - case '\\': - sb.append("_bk_slash_"); - break; - - case ';': - sb.append("_semicolon_"); - break; - - case '.': - sb.append("_period_"); - break; - - case '`': - sb.append("_tic_"); - break; - - default: - sb.append(ch); - break; - - } - - } - - return sb.toString(); - - } - } Deleted: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HybridTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HybridTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/HybridTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -1,227 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Sep 15, 2007 - */ - -package com.bigdata.util; - -import java.math.BigInteger; - -import org.apache.log4j.Logger; - -/** - * A timestamp factory using {@link System#currentTimeMillis()} and an internal - * counter to provide unique timestamps with greater than millisecond - * resolution. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - * - * @deprecated This class has not been fully debugged and SHOULD NOT be used. - */ -public class HybridTimestampFactory { - - /** - * Logger. - */ - public static final Logger log = Logger.getLogger(HybridTimestampFactory.class); - -// /** -// * Allows up to 1024 distinct timestamps per millisecond. -// */ -// public static HybridTimestampFactory INSTANCE = new HybridTimestampFactory(); - - /** - * The #of low bits in the generated timestamps that are allocated to the - * internal counter. - */ - private final int counterBits; - - /** - * The maximum value of the internal counter before it will rollover. On - * rollover the factory sleeps until a new time in milliseconds is reported - * by {@link System#currentTimeMillis()}. - */ - private final int maxCounter; - - /** - * The milliseconds component of the last generated timestamp (without - * erasure of the hit bits). - */ - private long lastTimestamp; - - /** - * The last value of the internal counter used to make a unique timestamp. - * This is reset each time the time returned by - * {@link System#currentTimeMillis()} differs from {@link #lastTimestamp}. - */ - private int counter = 0; - - /** - * The #of times the factory needed to sleep the current thread in order to - * generate a distinct timestamp. - */ - private long sleepCounter = 0L; - - /** - * The #of times the factory needed to sleep the current thread in order to - * generate a distinct timestamp. - */ - public long getSleepCounter() { - - return sleepCounter; - - } - - /** - * Allows up to 1024 distinct timestamps per millisecond. - */ - protected HybridTimestampFactory() { - - this( 10 ); - - } - - /** - * Allows up to <code>2^counterBits</code> distinct timestamps per - * millisecond. - * - * @param counterBits - * The #of bits in the long timestamp that are used to represent - * a counter. - * - * @todo Compute the maximum period after which the timestamps will - * overflow. - * - * @todo Set the epoch when the timestamp factory is created and persist - * that epoch so that overflow is set the maximum #of milliseconds - * into the future. Note that overflow will be the point after which - * we can no longer generate timestamps (aka transaction identifiers) - * for a given database. - */ - public HybridTimestampFactory(int counterBits) { - - if (counterBits < 0 || counterBits > 31) { - - // Note: would overflow an int32 at 32 bits. - - throw new IllegalArgumentException("counterBits must be in [0:31]"); - - } - - lastTimestamp = 0L; - - this.counterBits = counterBits; - - /* - * Construct a bit mask - this will have zeros in the high bits that - * correspond to the millis and ones in the low bits that correspond to - * the counter. - * - * @todo this is just Math.pow(2,counterBits)-1 and could be simplified as - * such (in the WormAddressManager also). - */ -// final long counterMask; -// { -// -// long mask = 0; -// -// long bit; -// -// for (int i = 0; i < counterBits; i++) { -// -// bit = (1L << i); -// -// mask |= bit; -// -// } -// -// counterMask = mask; -// -// } -// -// /* -// * The resulting mask is also the maximum value for the counter. -// */ -// -// maxCounter = (int)counterMask; - - maxCounter = BigInteger.valueOf(2).pow(counterBits).intValue() - 1; - - log.warn("#counterBits="+counterBits+", maxCounter="+maxCounter); - - } - - public long nextTimestamp() { - - long timestamp = System.currentTimeMillis(); - - // @todo this still does not work at counterBits == 0. - if (timestamp == lastTimestamp && (counter == maxCounter || counterBits == 0)) { - - // wait for the next millisecond. - - do { - - try { - -// System.err.print("S"); - - sleepCounter++; - - Thread.sleep(1/* ms */); - - } catch (InterruptedException ex) { - - /* ignore */ - - } - - timestamp = System.currentTimeMillis(); - - } while (timestamp == lastTimestamp); - - // this is a new millisecond. - - counter = 0; // reset the counter. - - lastTimestamp = timestamp; // update the last millisecond used. - - } else { - - // otherwise just increment the counter. - - counter++; - - } - - if (counterBits == 0) - return timestamp; - - return timestamp << counterBits | counter; - - } - -} Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/InnerCause.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/InnerCause.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/InnerCause.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -53,7 +53,6 @@ * @throws IllegalArgumentException * if any parameter is null. */ -// static public Throwable getInnerCause(Throwable t, Class cls) { static public Throwable getInnerCause(Throwable t, Class<? extends Throwable> cls) { if (t == null) @@ -97,8 +96,6 @@ * @throws IllegalArgumentException * if any parameter is null. */ -// static public boolean isInnerCause(Throwable t, Class cls) { - // Note: Use of generics commented out for 1.4 compatibility. static public boolean isInnerCause(Throwable t, Class<? extends Throwable>cls) { return getInnerCause(t, cls) != null; Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/MillisecondTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/MillisecondTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/MillisecondTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -105,7 +105,7 @@ assertPositive(lowerBound); - if (_lastTimestamp < lowerBound) { + if (lowerBound < _lastTimestamp) { log.warn("Timestamp factory is being set to an earlier time!"); @@ -161,7 +161,6 @@ // current time. long timestamp = System.currentTimeMillis(); - ; if (_autoIncMode) { @@ -182,8 +181,7 @@ _autoIncMode = false; - log - .warn("Leaving auto-increment mode: time is going forward again: lastTimestamp=" + log.warn("Leaving auto-increment mode: time is going forward again: lastTimestamp=" + _lastTimestamp + ", millisTime=" + timestamp); // fall through. @@ -226,8 +224,7 @@ * by this factory moving forward. */ - log - .warn("Entering auto-increment mode : milliseconds go backward: lastTimestamp=" + log.warn("Entering auto-increment mode : milliseconds go backward: lastTimestamp=" + _lastTimestamp + ", millisTime=" + timestamp); _autoIncMode = true; Deleted: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NanosecondTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NanosecondTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/NanosecondTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -1,90 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Oct 26, 2006 - */ - -package com.bigdata.util; - -/** - * Timestamp factory class with no more than nanosecond resolution - values - * produced by this class MUST NOT be persisted. - * <p> - * Note: There are several problems with {@link System#nanoTime()} to date and - * the values MUST NOT be persisted. The underlying problem is that the epoch - * MAY (and in practice does) change from VM instance to VM instance, often when - * the machine is rebooted. For this reason, nano time can appear to "go - * backward" rendering it unsuitable for placing timestamps on commit records. - * This means that we do not have access to time-based method with more than - * millisecond resolution of creating "distinctions" for transaction - * identifiers. - * <p> - * Note: Nano time could be made to work in a robust nano time service as long - * as the base time for the service is adjusted on service start or rollover to - * never go backward. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class NanosecondTimestampFactory { - - static long lastNanoTime = System.nanoTime(); - - /** - * Generates a timestamp with nanosecond precision that is guarenteed to be - * distinct from the last timestamp generated by this method within the same - * VM instance. - * - * @return A timestamp with nanosecond precision that MUST NOT be persisted. - */ - public static long nextNanoTime() { - - final int limit = 1000; - - int i = 0; - - long nanoTime; - - do { - - nanoTime = System.nanoTime(); - - if( i++ >= limit ) throw new AssertionError(); - - } while( nanoTime == lastNanoTime ); - - if(nanoTime<lastNanoTime) { - - throw new AssertionError("Nano time goes backward: lastNanoTime=" - + lastNanoTime + ", nanoTime=" + nanoTime); - - } - - lastNanoTime = nanoTime; - - return nanoTime; - - } - -} Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -65,17 +65,12 @@ // test of the millisecond resolution timestamp factory. suite.addTestSuite( TestMillisecondTimestampFactory.class ); - - // test of the nanosecond resolution timestamp factory. - suite.addTestSuite( TestNanosecondTimestampFactory.class ); - - // test of the hybrid timestamp factory. - // Note: class is not debugged and is marked as deprecated, test is commented out. -// suite.addTestSuite( TestHybridTimestampFactory.class ); - + suite.addTestSuite( TestCSVReader.class ); suite.addTestSuite( TestBootStateUtil.class ); suite.addTestSuite( TestEntryUtil.class ); + suite.addTestSuite( TestFormat.class ); + suite.addTestSuite( TestHTMLUtility.class ); return suite; } Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestFormat.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestFormat.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestFormat.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -0,0 +1,17 @@ +package com.bigdata.util; + +import junit.framework.TestCase; + +public class TestFormat extends TestCase { + + public TestFormat(String name) { + super(name); + } + + public void testFormat() { + String fmtString = "Roses are {0}, violets are {1}"; + Object[] fmtArgs = new Object[] { "red", "blue" }; + Format f = new Format(fmtString, fmtArgs); + assertTrue("Roses are red, violets are blue".equals(f.toString())); + } +} Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHTMLUtility.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHTMLUtility.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHTMLUtility.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -0,0 +1,31 @@ +package com.bigdata.util; + +import junit.framework.TestCase; + +public class TestHTMLUtility extends TestCase { + + public TestHTMLUtility(String name) { + super(name); + } + + public void testEscapeForXHTML() { + String bare = "A\"'<>&z"; + String expected = "A"'<>&z"; + String actual = HTMLUtility.escapeForXHTML(bare); + assertEquals(expected, actual); + } + public void testEscapeForXHTML_null() { + try { + HTMLUtility.escapeForXHTML(null); + fail("Successfully called escapeForXHTML with null."); + } catch (IllegalArgumentException e) { + //ignore -- expected + } + } + public void testEscapeForXHTML_empty() { + String expected = ""; + String actual = HTMLUtility.escapeForXHTML(""); + assertEquals(expected, actual); + } + +} Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHybridTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHybridTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestHybridTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -1,101 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Sep 15, 2007 - */ - -package com.bigdata.util; - -import junit.framework.TestCase; - -/** - * Test suite for {@link HybridTimestampFactory}. - * - * @todo test ctor correct acceptance and correct rejection and internally - * computed fields. - * - * @todo test with all legal ctor values for counterBits and plot the #of - * distinct timestamps per millisecond as a function of counterBits. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestHybridTimestampFactory extends TestCase { - - /** - * - */ - public TestHybridTimestampFactory() { - super(); - } - - /** - * @param arg0 - */ - public TestHybridTimestampFactory(String arg0) { - super(arg0); - } - - /** - * Test verifies that timestamps are always distinct from the last generated - * timestamp as generated by {@link HybridTimestampFactory#nextMillis()} and - * notes the actual granularity of the generated timestamps. - */ - public void test_nextTimestamp2() { - - final int limit = 100000; - - HybridTimestampFactory timestampFactory = new HybridTimestampFactory(10); - - final long begin = System.currentTimeMillis(); - - long lastTimestamp = begin - 1; - - long timestamp; - - for( int i=0; i<limit; i++ ) { - - timestamp = timestampFactory.nextTimestamp(); - - if (timestamp == lastTimestamp) - fail("Same timestamp?"); - - if (timestamp < lastTimestamp) - fail("Time goes backwards?"); - - lastTimestamp = timestamp; - - } - - long elapsed = System.currentTimeMillis() - begin; - - System.err.println("Generated " + limit + " timestamps in " + elapsed - + " milliseconds: ts/ms: " + limit / (double) elapsed); - - System.err.println("The #of times the factory invoked Thread.sleep(): " - + timestampFactory.getSleepCounter()); - - } - -} Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestInnerCause.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestInnerCause.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestInnerCause.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -58,6 +58,11 @@ } + protected boolean isInnerCause(Throwable t, Class<? extends Throwable> cls) { + + return InnerCause.isInnerCause(t, cls); + + } public void test_getInnerCause_correctRejection() { try { @@ -91,7 +96,7 @@ Throwable t = new RuntimeException(); assertTrue(t == getInnerCause(t, RuntimeException.class)); - + assertTrue(isInnerCause(t, RuntimeException.class)); } /** @@ -103,7 +108,8 @@ Throwable t = new IOException(); assertTrue(t == getInnerCause(t, Exception.class)); - + assertTrue(isInnerCause(t, Exception.class)); + } /** @@ -114,7 +120,8 @@ Throwable t = new Exception(); assertNull(getInnerCause(t, IOException.class)); - + assertFalse(isInnerCause(t, IOException.class)); + } /** @@ -126,7 +133,8 @@ Throwable t = new Throwable(); assertNull(getInnerCause(t, Exception.class)); - + assertFalse(isInnerCause(t, Exception.class)); + } /** @@ -139,6 +147,7 @@ Throwable t = new Throwable(cause); assertTrue(cause == getInnerCause(t, Exception.class)); + assertTrue(isInnerCause(t, Exception.class)); } @@ -152,6 +161,7 @@ Throwable t = new Throwable(cause); assertTrue(cause == getInnerCause(t, Exception.class)); + assertTrue(isInnerCause(t, Exception.class)); } @@ -165,7 +175,8 @@ Throwable t = new RuntimeException(cause); assertNull( getInnerCause(t, IOException.class)); - + assertFalse(isInnerCause(t, IOException.class)); + } /** @@ -179,7 +190,7 @@ Throwable t = new Exception(cause); assertNull( getInnerCause(t, IOException.class) ); - + assertFalse(isInnerCause(t, IOException.class)); } } Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestMillisecondTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestMillisecondTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestMillisecondTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -165,4 +165,24 @@ } + public void test_nextMillis_wrap() { + final long startMillis = Long.MAX_VALUE; + MillisecondTimestampFactory.setLowerBound(startMillis); + try { + long timestamp = MillisecondTimestampFactory.nextMillis(); + fail("Successfully called nextMillis() with wrap aorund."); + } catch (IllegalStateException e) { + //ignore -- expected + } + } + + public void test_setLowerBound() { + final long startMillis = Long.MAX_VALUE; + //Synch to ensure atomic calling sequence + synchronized(MillisecondTimestampFactory.class) { + MillisecondTimestampFactory.setLowerBound(startMillis); + //Setting lower bound clears auot-inc mode + assertFalse(MillisecondTimestampFactory.isAutoIncMode()); + } + } } Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNanosecondTimestampFactory.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNanosecondTimestampFactory.java 2010-09-27 18:28:54 UTC (rev 3639) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestNanosecondTimestampFactory.java 2010-09-27 18:53:19 UTC (rev 3640) @@ -1,128 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Oct 26, 2006 - */ - -package com.bigdata.util; - -import junit.framework.TestCase; - -/** - * Test suite for {@link NanosecondTimestampFactory}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestNanosecondTimestampFactory extends TestCase { - - public TestNanosecondTimestampFactory() { - - } - - public TestNanosecondTimestampFactory(String arg0) { - - super(arg0); - - } - - /** - * Test determines whether nano times are always distinct from the last - * generated nanos time (as assigned by {@link System#nanoTime()}. - * <p> - * Note: This test is NOT designed to pass/fail but simply to test determine - * a characteristic of the platform on which it is executing. - */ - public void test_nextNanoTime() { - - final int limit = 1000000; - - long lastNanoTime = System.nanoTime(); - long nanoTime; - long minDiff = Long.MAX_VALUE; - - for( int i=0; i<limit; i++ ) { - - nanoTime = System.nanoTime(); - - if (nanoTime == lastNanoTime) { - - System.err - .println("This platform can generate identical timestamps with nanosecond resolution"); - - return; - - } - - long diff = nanoTime - lastNanoTime; - - if( diff < 0 ) diff = -diff; - - if( diff < minDiff ) minDiff = diff; - - lastNanoTime = nanoTime; - - } - - System.err.println("Nano times appear to be distinct on this platorm."); - - System.err.println("Minimum difference in nanos is " + minDiff - + " over " + limit + " trials"); - - } - - /** - * Test verifies that nano times are always distinct from the last generated - * nanos time (as assigned by {@link NanosecondTimestampFactory#nextNanoTime()}. - */ - public void test_nextNanoTime2() { - - final int limit = 1000000; - - long lastNanoTime = System.nanoTime() - 1; - long nanoTime; - long minDiff = Long.MAX_VALUE; - - for( int i=0; i<limit; i++ ) { - - nanoTime = NanosecondTimestampFactory.nextNanoTime(); - - if( nanoTime == lastNanoTime ) fail("Same nano time?"); - - long diff = nanoTime - lastNanoTime; - - if( diff < 0 ) diff = -diff; - - if( diff < minDiff ) minDiff = diff; - - lastNanoTime = nanoTime; - - } - - System.err.println("Minimum difference in nanos is " + minDiff - + " over " + limit + " trials"); - - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-27 18:29:01
|
Revision: 3639 http://bigdata.svn.sourceforge.net/bigdata/?rev=3639&view=rev Author: blevine218 Date: 2010-09-27 18:28:54 +0000 (Mon, 27 Sep 2010) Log Message: ----------- add target to kill the QuorumPeerMain processes that remain after the integration tests are run. NOTE: This currently makes this part of the integration-tests Unix dependent. We might need to tune this a bit depending on supported Unix flavors. Modified Paths: -------------- branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml Added Paths: ----------- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh Added: branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh =================================================================== --- branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh (rev 0) +++ branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh 2010-09-27 18:28:54 UTC (rev 3639) @@ -0,0 +1,2 @@ +#! /bin/bash +kill `jps | grep QuorumPeerMain | cut -d' ' -f1 ` Property changes on: branches/maven_scaleout/bigdata-integ/src/test/resources/kill_leftover_processes.sh ___________________________________________________________________ Added: svn:executable + * Modified: branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml =================================================================== --- branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml 2010-09-27 17:53:18 UTC (rev 3638) +++ branches/maven_scaleout/bigdata-integ/src/test/resources/services.xml 2010-09-27 18:28:54 UTC (rev 3639) @@ -1,30 +1,10 @@ <project name="bigdata-integration-lookup-starter" default="help" basedir="."> -<!-- - <property name="integ.deploy.dir" location="${basedir}/.." /> - <property name="integ.app.home" location="${deploy.dir}" /> - <property name="integ.deploy.conf.dir" location="${deploy.dir}/conf" /> - <property name="integ.deploy.lib" location="${deploy.dir}/lib" /> - <property name="integ.deploy.lib.test" location="${deploy.dir}/testing/lib-test" /> - <property name="integ.deploy.lib.dl" location="${deploy.dir}/lib-dl" /> - <property name="integ.test.codebase.dir" location="${deploy.lib.dl}" /> - <property name="integ.test.codebase.port" value="23333" /> - <property name="integ.java.security.policy" location="conf/policy.all" /> - <property name="integ.log4j.configuration" location="${deploy.dir}/var/config/logging/log4j.properties" /> - <property name="integ.java.net.preferIPv4Stack" value="true" /> - <property name="integ.default.nic" value="eth0" /> - <property name="integ.parent.artifactName" value="bigdata-core" /> ---> - - <!-- Set to the empty string to indicate "unset". Application code will determine correct - default value. - <property name="integ.federation.name" value="" /> - --> - + <target name="help"> <echo level="error" message="This script must be run with either the 'start' or 'stop' targets" /> - <antcall target="dumpProps" /> + <antcall target="dumpProps" /> </target> - + <target name="dumpProps"> <echo message="Application properties:" /> <echo message="-----------------------" /> @@ -44,6 +24,7 @@ <antcall target="dumpProps" /> <antcall target="stopLookup" /> <antcall target="stopHttpd" /> + <antcall target="kill-leftover-processes" /> </target> <target name="startHttpd"> @@ -97,6 +78,16 @@ </java> </target> + <!-- Some tests currently leave processes (e.g. QuorumPeerMain) hanging around after + the tests have completed. This task kills those processes (Unix-only). --> + + <target name="kill-leftover-processes"> + <echo message="Killing leftover processes" /> + <chmod file="${basedir}/kill_leftover_processes.sh" perm="777" verbose="true" /> + <exec spawn="false" resolveexecutable="true" executable="kill_leftover_processes.sh"> + </exec> + </target> + <target name="clean-sparql-test-suite" description="delete the files unpacked by the Sesame SPARQL test suite."> <echo>"clearing: ${java.io.tmpdir}/sparql-*"</echo> <delete verbose="true"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgo...@us...> - 2010-09-27 17:53:25
|
Revision: 3638 http://bigdata.svn.sourceforge.net/bigdata/?rev=3638&view=rev Author: sgossard Date: 2010-09-27 17:53:18 +0000 (Mon, 27 Sep 2010) Log Message: ----------- [maven_scaleout] : Minor tweak so maven will look for parent pom in the parent directory, which can reduce what needs to be previously installed via 'mvn install' when building a single sub-module. Modified Paths: -------------- branches/maven_scaleout/bigdata-integ/pom.xml Modified: branches/maven_scaleout/bigdata-integ/pom.xml =================================================================== --- branches/maven_scaleout/bigdata-integ/pom.xml 2010-09-27 16:28:41 UTC (rev 3637) +++ branches/maven_scaleout/bigdata-integ/pom.xml 2010-09-27 17:53:18 UTC (rev 3638) @@ -3,6 +3,7 @@ <groupId>com.bigdata</groupId> <artifactId>bigdata</artifactId> <version>0.83.2-SNAPSHOT</version> + <relativePath>../</relativePath> </parent> <modelVersion>4.0.0</modelVersion> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-09-27 16:28:50
|
Revision: 3637 http://bigdata.svn.sourceforge.net/bigdata/?rev=3637&view=rev Author: martyncutcher Date: 2010-09-27 16:28:41 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Checkin of CTC Striterators with revised license Added Paths: ----------- branches/QUADS_QUERY_BRANCH/ctc-striterators/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ArrayIterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EmptyIterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EnumIterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ExclusionFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IStriterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXProperty.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXPropertyIterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/SingleValueIterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Sorterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Striterator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/UniquenessFilter.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitor.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Visitorator.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/XProperty.java branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/XPropertyIterator.java Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,52 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Appender + * + * Used with Appenderator by Striterator to filter returned objects. + */ + +public class Appender implements IFilter { + protected Iterator m_xtra = null; + + public Appender() {} + + public Appender(Iterator xtra) { + m_xtra = xtra; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Appenderator(src, (Iterator) m_xtra); + } + + //------------------------------------------------------------- +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appender.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,75 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * Appenderator + **/ + +public class Appenderator implements Iterator { + + Iterator m_src; + Iterator m_xtra; + + Iterator m_current; + + public Appenderator(Iterator src, Iterator xtra) { + m_src = src; + m_xtra = xtra; + + m_current = m_src; + } + + //------------------------------------------------------------- + + public boolean hasNext() { + if (m_current.hasNext()) { + return true; + } + + m_current = m_xtra; + + return m_current.hasNext(); + } + + //------------------------------------------------------------- + // must call hasNext() to ensure m_current is correct + public Object next() { + if (hasNext()) { + return m_current.next(); + } + + throw new NoSuchElementException("FilterIterator"); + } + + //------------------------------------------------------------- + + public void remove() { + m_current.remove(); + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Appenderator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ArrayIterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ArrayIterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ArrayIterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,56 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Supports standard iteration over an object Array, allowing this to + * be used as a source for a <code>Striterator</code>. + */ +public class ArrayIterator implements Iterator { + Object[] m_src = null; + int m_index = 0; + + /** Constructor takes source object array **/ + public ArrayIterator(Object[] src) { + m_src = src; + } + + /** checks with current index and array size **/ + public boolean hasNext() { + return m_src != null && m_src.length > m_index; + } + + /** @return current index from array **/ + public Object next() { + return m_src[m_index++]; + } + + /** void .. does nothing **/ + public void remove() { + } +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ArrayIterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,55 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Used with a Contractorator to contract an Expanded iterator + * + * The Contractorator will call contract on this object + * @author Martyn Cutcher + */ +public abstract class Contractor implements IFilter { + + protected Object m_state = null; + + public Contractor() { } + + public Contractor(Object state) { + m_state = state; + } + + //------------------------------------------------------------- + + public Iterator filter(Iterator src) { + return new Contractorator(src, this); + } + + //------------------------------------------------------------- + + protected abstract Object contract(Iterator src); +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractor.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,76 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * A Contractorator is the reverse of an Expanderator. A Contractorator takes a + * source Iterator, and consumes elements from it in batches by passing to the + * Contractor which returns an object when ready. It is upto the Contractor to + * handle termination conditions. For example, it might batch consume the + * objects ten at a time with some summary info, but handle that there may be + * less than ten elements in the final summary. + * + * A Contractor could also be used to chunk up a number of objects for + * serialization, perhaps for network transmission. Such a pattern might be used + * with an Expander on the other side to deserialize into an iterator. + * + * @author Martyn Cutcher + */ +public class Contractorator implements Iterator { + Iterator m_src; + Contractor m_contractor; + Object m_next; + + public Contractorator(Iterator src, Contractor contractor) { + m_src = src; + m_contractor = contractor; + + m_next = m_contractor.contract(m_src); + } + + public boolean hasNext() { + return m_next != null; + } + + public Object next() { + if (m_next == null) { + throw new NoSuchElementException(); + } + + Object ret = m_next; + m_next = m_contractor.contract(m_src); + + return ret; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Contractorator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EmptyIterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EmptyIterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EmptyIterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,50 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/*************************************************************************** + * <p>Need to return an iterator to indicate that there's nothing there? Here's + * one ready made.</p> + * + * <p>It allows calls to be made without needing to check for a null iterator.</p> + */ + +public final class EmptyIterator implements Iterator { + public boolean hasNext() { + return false; + } + + public Object next() { + return null; + } + + public void remove() {} + + final static public EmptyIterator DEFAULT = new EmptyIterator(); +} + Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EmptyIterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EnumIterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EnumIterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EnumIterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,54 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; +import java.util.Enumeration; + +/** + * Wrapper for Enumeration objects to produce an Iterator. + */ + +public class EnumIterator implements Iterator { + + protected Enumeration m_enum = null; + + public EnumIterator(Enumeration p_enum) { + m_enum = p_enum; + } + + public boolean hasNext() { + return m_enum.hasMoreElements(); + } + + public Object next() { + return m_enum.nextElement(); + } + + public void remove() { + throw new UnsupportedOperationException("Remove Not Supported by underlying Enumeration"); + } +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/EnumIterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ExclusionFilter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ExclusionFilter.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ExclusionFilter.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,42 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +/****************************************************************************** + * Derived from Filter, and excludes a single object from the iteration. + */ +public class ExclusionFilter extends Filter { + public ExclusionFilter(Object state) { + super(state); + } + + /*********************************************************************** + * Just make sure that the current object is not the one to be excluded. + **/ + protected boolean isValid(Object obj) { + return obj != m_state; + } +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/ExclusionFilter.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,56 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Expander + * + * Used with Expanderator by Striterator to expand returned objects. + * + * Derivations must implement expand method. + */ + +public abstract class Expander implements IFilter { + protected Object m_state = null; + + public Expander() { } + + public Expander(Object state) { + m_state = state; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Expanderator(src, this); + } + + //------------------------------------------------------------- + + protected abstract Iterator expand(Object obj); +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expander.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,81 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * Expanderator + * + * Flattens out a two-level iteration. By combining Expanderators recursively a general tree + * iteration is provided. + * + * Provides resolution for both the child object and also the nested iterator. + * The actual expansion is via an Expander object that is passed in at construction. + */ + +public class Expanderator implements Iterator { + + Iterator m_src; + Iterator m_child = null; + + Expander m_expander; + + public Expanderator(Iterator src, Expander expander) { + m_src = src; + m_expander = expander; + } + + //------------------------------------------------------------- + + public boolean hasNext() { + if (m_child != null && m_child.hasNext()) { + return true; + } else if (m_src.hasNext()) { + m_child = m_expander.expand(m_src.next()); + + return hasNext(); + } else { + return false; + } + } + + //------------------------------------------------------------- + // must call hasNext() to ensure m_child is setup + public Object next() { + if (hasNext()) { + return m_child.next(); + } + + throw new NoSuchElementException("Expanderator"); + } + + //------------------------------------------------------------- + + public void remove() { + m_child.remove(); + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Expanderator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,52 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Used with Filterator by Striterator to filter returned objects. + */ +public abstract class Filter implements IFilter { + + protected Object m_state = null; + + public Filter() {} + + public Filter(Object state) { + m_state = state; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Filterator(src, this); + } + + //------------------------------------------------------------- + + protected abstract boolean isValid(Object obj); +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filter.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,95 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * <p>Example usage</p> + * <pre> + * Iterator src = new Filterator(old, new Filter(state)) { + * boolean isValid(Object object) { + * return object == m_state; + * } + * } ); + * </pre> + * + * <p>The Filterator provide the protocol support to utulise Filter objects.</p> + */ + +public class Filterator implements Iterator { + + Iterator m_src; + Object m_value = null; + + protected Filter m_filter = null; + + public Filterator(Iterator src, Filter filter) { + m_src = src; + m_filter = filter; + + m_value = getNext(); + } + + //------------------------------------------------------------- + + public boolean hasNext() { + return m_value != null; + } + + //------------------------------------------------------------- + // must call hasNext() to ensure m_child is setup + public Object next() { + if (hasNext()) { + Object val = m_value; + m_value = getNext(); + + return val; + } + + throw new NoSuchElementException("FilterIterator"); + } + + //------------------------------------------------------------- + + public void remove() { + m_src.remove(); + } + + //------------------------------------------------------------- + + protected Object getNext() { + while (m_src.hasNext()) { + Object next = m_src.next(); + + if (m_filter.isValid(next)) { + return next; + } + } + + return null; + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Filterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,47 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +package cutthecrap.utils.striterators; + +import java.util.Iterator; +import java.io.Serializable; + +/** + * Provides the hook interface that allows use by Striterators + */ +public interface IFilter extends Serializable { + /** + * <p>The filter method is provided to allow the creation of the filtering iterator.</p> + * + * <p>Any implementation should follow the following pattern:</p> + * <pre> + * public Iterator filter(Iterator src) { + * return new Filterator(src, this); + * } + * </pre> + **/ + public abstract Iterator filter(Iterator src); +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IFilter.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IStriterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IStriterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IStriterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,62 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.lang.reflect.Method; +import java.util.Iterator; +import java.util.Enumeration; + +/** + * IStriterator + * + * Extends the Iterator interface to expose methods to add IFilter objects and a specific Type filter + */ + +public interface IStriterator extends Iterator, Enumeration { + /** Adds a Discriminating IFilter object **/ + public IStriterator addFilter(IFilter filter); + + /** check each object against cls.isInstance(object) **/ + public IStriterator addTypeFilter(Class cls); + + /** check each object against object.getClass() == cls **/ + public IStriterator addInstanceOfFilter(Class cls); + + /** exclude the passed object from the iteration **/ + public IStriterator exclude(Object object); + + /** append the passed iteration **/ + public IStriterator append(Iterator iter); + + /** Ensures the returned values appear only once **/ + public IStriterator makeUnique(); + + /** map the clients method against the Iteration, the Method MUST take a single Object valued parameter. + * can be called by : + * iter.map(this, MyClass.aMethod); + **/ + public IStriterator map(Object client, Method method); +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IStriterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXProperty.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXProperty.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXProperty.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,37 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +/** IXProperty.java + */ + +public interface IXProperty { + /** Returns the key of the property **/ + public String getKey(); + + /** Returns the value of the property **/ + public Object getValue(); +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXProperty.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXPropertyIterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXPropertyIterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXPropertyIterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,36 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +/** + * IXPropertyIterator + * + * A standard iterator, extended to provide a nextProperty method returning IXProperty objects + **/ + +public interface IXPropertyIterator extends IStriterator { + public IXProperty nextProperty(); +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/IXPropertyIterator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,64 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; +import java.lang.reflect.Method; + +/** + * Mapper + * + * Used with Mapperator by Striterator to map instance methods against member objects. + */ + +public class Mapper implements IFilter { + protected Object m_client = null; + protected Method m_method = null; + protected Object[] m_args = {null}; + + public Mapper(Object client, Method method) { + m_client = client; + m_method = method; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Mapperator(src, this); + } + + //------------------------------------------------------------- + + protected void apply(Object obj) { + try { + m_args[0] = obj; + + m_method.invoke(m_client, m_args); + } catch (Exception e) { + throw new RuntimeException("Error on mapping method", e); + } + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapper.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,61 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * Mapperator + * + * Initialized with a Mapper object, wraps a standard iterator and calls apply on each object as it is iterated + */ + +public class Mapperator implements Iterator { + + Iterator m_iter; + Mapper m_mapper; + + public Mapperator(Iterator iter, Mapper mapper) { + m_iter = iter; + m_mapper = mapper; + } + + public boolean hasNext() { + return m_iter.hasNext(); + } + + public Object next() { + Object obj = m_iter.next(); + + m_mapper.apply(obj); + + return obj; + } + + public void remove() { + m_iter.remove(); + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mapperator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,53 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; +import java.util.Comparator; + +/** + * Used with Mergerator by Striterator to merge returned objects. + */ + +public class Merger implements IFilter { + protected Iterator m_xtra = null; + protected Comparator m_comparator = null; + + public Merger() {} + + public Merger(Iterator xtra, Comparator comparator) { + m_xtra = xtra; + m_comparator = comparator; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Mergerator(src, m_xtra, m_comparator); + } + + //------------------------------------------------------------- +} Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Merger.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,88 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * Merges two sorted lists removing equal objects. For example, two sorted + * lists of Strings to create a single list with no duplicates. + **/ +public class Mergerator implements Iterator { + + Iterator m_setA; + Iterator m_setB; + Comparator m_comparator; + + Object m_valA = null; + Object m_valB = null; + + public Mergerator(Iterator setA, Iterator setB, Comparator comparator) { + m_setA = setA; + m_setB = setB; + + m_comparator = comparator; + + if (m_setA.hasNext()) { + m_valA = m_setA.next(); + } + + if (m_setB.hasNext()) { + m_valB = m_setB.next(); + } + } + + //------------------------------------------------------------- + + public boolean hasNext() { + return m_valA != null || m_valB != null; + } + + //------------------------------------------------------------- + // must call hasNext() to ensure m_current is correct + public Object next() { + if (hasNext()) { + Object retVal = null; + + if (m_valB == null || (m_valA != null && (m_comparator.compare(m_valA, m_valB) <= 0))) { + retVal = m_valA; + m_valA = m_setA.hasNext() ? m_setA.next() : null; + } else { + retVal = m_valB; + m_valB = m_setB.hasNext() ? m_setB.next() : null; + } + return retVal; + } else { + throw new NoSuchElementException("Mergerator"); + } + } + + //------------------------------------------------------------- + + public void remove() { + throw new RuntimeException("Cannot remove object from merged set"); + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Mergerator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,56 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.Iterator; + +/** + * Resolver + * + * Used with Resolverator by Striterator to resolve returned objects. + * + * Cannot be instantiated directly since an implementation of the resolve method is required. + */ + +public abstract class Resolver implements IFilter { + protected Object m_state = null; + + public Resolver() {} + + public Resolver(Object state) { + m_state = state; + } + + //------------------------------------------------------------- + + final public Iterator filter(Iterator src) { + return new Resolverator(src, this); + } + + //------------------------------------------------------------- + + protected abstract Object resolve(Object obj); +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolver.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,57 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/** + * Resolverator + * + * Initialized with a Resolver object, wraps a standard iterator and resolves each returned object + */ + +public class Resolverator implements Iterator { + + Iterator m_iter; + Resolver m_resolver; + + public Resolverator(Iterator iter, Resolver resolver) { + m_iter = iter; + m_resolver = resolver; + } + + public boolean hasNext() { + return m_iter.hasNext(); + } + + public Object next() { + return m_resolver.resolve(m_iter.next()); + } + + public void remove() { + m_iter.remove(); + } +} \ No newline at end of file Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/Resolverator.java ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/SingleValueIterator.java =================================================================== --- branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/SingleValueIterator.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/utils/striterators/SingleValueIterator.java 2010-09-27 16:28:41 UTC (rev 3637) @@ -0,0 +1,61 @@ +/* +Striterator - transformation and mapping patterns over java Iterators + +Copyright (C) SYSTAP, LLC 2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package cutthecrap.utils.striterators; + +import java.util.*; + +/*************************************************************************** + * SingleValueIterator + * + * Only one value but need to return an iterator? This makes it easy. + */ + + public class SingleValueIterator implements Iterator { + Object m_value; + boolean m_hasNext = true; + + public SingleValueIterator(Object value) { + m_value = value; + } + public boolean hasNext() { + return m_hasNext; + } + public Object next() { + if (!m_hasNext) { + m_value = null; + } else { + m_hasNext = false; + } + + return m_value; + } + public void remove() { + m_hasNext = false; + m_value = null; + } +} + + Property changes on: branches/QUADS_QUERY_BRANCH/ctc-striterators/src/java/cutthecrap/util... [truncated message content] |
From: <dm...@us...> - 2010-09-27 16:12:20
|
Revision: 3636 http://bigdata.svn.sourceforge.net/bigdata/?rev=3636&view=rev Author: dmacgbr Date: 2010-09-27 16:12:12 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Added some tests. Updated operators w.r.t the 'not bound yet' case as discussed. e.g. when, say EQ, is evaluated and EQ's variable is not in the IBindingSet, it now returns false rather than true. It is expected that all variables that are going to be bound will have been bound prior to evaluation. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NE.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NEConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInBinarySearch.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInHashMap.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNE.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNEConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestOR.java Added Paths: ----------- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -73,13 +73,13 @@ final IConstant<?> x = s.get((IVariable<?>) get(0)/* x */); if (x == null) - return true; // not yet bound. + return false; // not bound. // get binding for "y". final IConstant<?> y = s.get((IVariable<?>) get(1)/* y */); if (y == null) - return true; // not yet bound. + return false; // not bound. return x.equals(y); Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -78,7 +78,7 @@ final IConstant<?> asBound = bset.get(var); if (asBound == null) - return true; // not yet bound. + return false; // not bound. final IConstant<?> cnst = (IConstant<?>) get(1); Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -181,8 +181,8 @@ if (x == null) { - // not yet bound : @todo should this reject an unbound variable? - return true; + // not bound + return false; } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -159,8 +159,8 @@ if (x == null) { - // not yet bound. - return true; + // not bound. + return false; } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NE.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NE.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NE.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -26,11 +26,9 @@ import java.util.Map; -import com.bigdata.bop.BOpBase; import com.bigdata.bop.BOp; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.IConstant; -import com.bigdata.bop.IConstraint; import com.bigdata.bop.IVariable; /** Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NEConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NEConstant.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/NEConstant.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -26,11 +26,9 @@ import java.util.Map; -import com.bigdata.bop.BOpBase; import com.bigdata.bop.BOp; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.IConstant; -import com.bigdata.bop.IConstraint; import com.bigdata.bop.IVariable; /** Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -114,4 +114,15 @@ } + public void test_eval_correct_unblound() { + + final EQ op = new EQ(Var.var("x"), Var.var("y")); + + final IBindingSet bs1 = new ArrayBindingSet(// + new IVariable[] { Var.var("x") }, // + new IConstant[] { new Constant<String>("1") }); + + assertFalse(op.accept(bs1)); + + } } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -29,6 +29,13 @@ import junit.framework.TestCase2; +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + /** * Unit tests for {@link EQConstant}. * @@ -50,8 +57,40 @@ super(name); } - public void test_something() { - fail("write tests"); + /** + * Unit test for {@link EQConstant#EQConstant(IVariable,IConstant)} + */ + public void testConstructor () + { + try { assertTrue ( null != new EQConstant ( null, new Constant<String> ( "1" ) ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != new EQConstant ( Var.var ( "x" ), null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + assertTrue ( null != new EQConstant ( Var.var ( "x" ), new Constant<String> ( "1" ) ) ) ; } - -} + + /** + * Unit test for {@link EQConstant#accept(IBindingSet)} + */ + public void testAccept () + { + Var<?> var = Var.var ( "x" ) ; + Constant<String> val1 = new Constant<String> ( "1" ) ; + Constant<String> val2 = new Constant<String> ( "2" ) ; + Constant<Integer> val3 = new Constant<Integer> ( 1 ) ; + + EQConstant op = new EQConstant ( var, val1 ) ; + + IBindingSet eq = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val1 } ) ; + IBindingSet ne1 = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val2 } ) ; + IBindingSet ne2 = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val3 } ) ; + IBindingSet nb = new ArrayBindingSet ( new IVariable<?> [] {}, new IConstant [] {} ) ; + + assertTrue ( op.accept ( eq ) ) ; + assertFalse ( op.accept ( ne1 ) ) ; + assertFalse ( op.accept ( ne2 ) ) ; + assertFalse ( op.accept ( nb ) ) ; + } +} \ No newline at end of file Added: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -0,0 +1,132 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 2, 2010 + */ + +package com.bigdata.bop.constraint; + +import java.util.Arrays; + +import junit.framework.TestCase2; + +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + +/** + * Unit tests for {@link INHashMap}. + * + * @author <a href="mailto:dm...@us...">David MacMillan</a> + * @version $Id:$ + */ +public abstract class TestINConstraint extends TestCase2 +{ + /** + * + */ + public TestINConstraint () + { + } + + /** + * @param name + */ + public TestINConstraint ( String name ) + { + super ( name ) ; + } + + /** + * Unit test for {@link INHashMap#INHashMap(IVariable<T>,IConstant<T>[])} + */ + public void testConstructor () + { + IVariable<Integer> var = Var.var ( "x" ) ; + IConstant<Integer> vals [] = new IConstant [] { new Constant<Integer> ( 1 ) } ; + + try { assertTrue ( null != newINConstraint ( null, vals ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != newINConstraint ( var, null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != newINConstraint ( var, new IConstant [] {} ) ) ; fail ( "IllegalArgumentException expected, set was empty" ) ; } + catch ( IllegalArgumentException e ) {} + + assertTrue ( null != newINConstraint ( var, vals ) ) ; + } + + /** + * Unit test for {@link INConstraint#getVariable()} + */ + public void testGetVariable () + { + Var<?> x = Var.var ( "x" ) ; + IConstant vals [] = new Constant [] { new Constant<Integer> ( 1 ) } ; + + INConstraint op = newINConstraint ( x, vals ) ; + + assertTrue ( x.equals ( op.getVariable () ) ) ; + } + + /** + * Unit test for {@link INConstraint#getSet()} + */ + public void testGetSet () + { + Var<?> x = Var.var ( "x" ) ; + IConstant vals [] = new Constant [] { new Constant<Integer> ( 1 ) } ; + + INConstraint op = newINConstraint ( x, vals ) ; + + assertTrue ( Arrays.equals ( vals, op.getSet () ) ) ; + } + + /** + * Unit test for {@link INConstraint#accept(IBindingSet)} + */ + public void testAccept () + { + Var<?> x = Var.var ( "x" ) ; + Constant<Integer> val1 = new Constant<Integer> ( 1 ) ; + Constant<Integer> val2 = new Constant<Integer> ( 2 ) ; + Constant<Integer> val3 = new Constant<Integer> ( 3 ) ; + + INConstraint op = newINConstraint ( x, new IConstant [] { val1, val2 } ) ; + + IBindingSet in = new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { val1 } ) ; + IBindingSet notin = new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { val3 } ) ; + IBindingSet nb = new ArrayBindingSet ( new IVariable<?> [] {}, new IConstant [] {} ) ; + + assertTrue ( op.accept ( in ) ) ; + assertFalse ( op.accept ( notin ) ) ; + assertFalse ( op.accept ( nb ) ) ; + } + + protected abstract INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) ; +} \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInBinarySearch.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInBinarySearch.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInBinarySearch.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -27,15 +27,24 @@ package com.bigdata.bop.constraint; -import junit.framework.TestCase2; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + /** * Unit tests for {@link INBinarySearch}. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public class TestInBinarySearch extends TestCase2 { +public class TestInBinarySearch extends TestINConstraint { /** * @@ -50,8 +59,34 @@ super(name); } - public void test_something() { - fail("write tests"); + /** + * Unit test for {@link INConstraint#accept(IBindingSet)} + */ + public void testAccept () + { + super.testAccept () ; + + // specific test because the implementation does a sort, etc... + + Var<?> x = Var.var ( "x" ) ; + + IConstant [] vals = new IConstant [ 100 ] ; + for ( int i = 0; i < vals.length; i++ ) + vals [ i ] = new Constant<Integer> ( i ) ; + List<IConstant> list = Arrays.asList ( vals ) ; + Collections.shuffle ( list ) ; + vals = list.toArray ( vals ) ; + + INConstraint op = new INBinarySearch ( x, vals ) ; + + assertTrue ( op.accept ( new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { new Constant<Integer> ( 21 ) } ) ) ) ; + assertTrue ( op.accept ( new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { new Constant<Integer> ( 37 ) } ) ) ) ; + assertTrue ( op.accept ( new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { new Constant<Integer> ( 75 ) } ) ) ) ; + assertFalse ( op.accept ( new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { new Constant<Integer> ( 101 ) } ) ) ) ; } - -} + + @Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) + { + return new INBinarySearch ( var, vals ) ; + } +} \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInHashMap.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInHashMap.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestInHashMap.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -27,7 +27,8 @@ package com.bigdata.bop.constraint; -import junit.framework.TestCase2; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; /** * Unit tests for {@link INHashMap}. @@ -35,8 +36,8 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public class TestInHashMap extends TestCase2 { - +public class TestInHashMap extends TestINConstraint +{ /** * */ @@ -50,8 +51,8 @@ super(name); } - public void test_something() { - fail("write tests"); + @Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) + { + return new INHashMap ( var, vals ) ; } - -} +} \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNE.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNE.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNE.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -29,6 +29,13 @@ import junit.framework.TestCase2; +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + /** * Unit tests for {@link NE}. * @@ -50,8 +57,40 @@ super(name); } - public void test_something() { - fail("write tests"); + /** + * Unit test for {@link NE#NE(IVariable,IVariable)} + */ + public void testConstructor () + { + try { assertTrue ( null != new NE ( null, Var.var ( "y" ) ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != new NE ( Var.var ( "x" ), null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != new NE ( Var.var ( "x" ), Var.var ( "x" ) ) ) ; fail ( "IllegalArgumentException expected, lhs identical to rhs" ) ; } + catch ( IllegalArgumentException e ) {} + + assertTrue ( null != new NE ( Var.var ( "x" ), Var.var ( "y" ) ) ) ; } - -} + + /** + * Unit test for {@link NE#accept(IBindingSet)} + */ + public void testAccept () + { + Var<?> x = Var.var ( "x" ) ; + Var<?> y = Var.var ( "y" ) ; + Var<?> vars [] = new Var<?> [] { x, y } ; + + NE op = new NE ( x, y ) ; + + IBindingSet eq = new ArrayBindingSet ( vars, new IConstant [] { new Constant<String> ( "1" ), new Constant<String> ( "1" ) } ) ; + IBindingSet ne = new ArrayBindingSet ( vars, new IConstant [] { new Constant<String> ( "1" ), new Constant<String> ( "2" ) } ) ; + IBindingSet nb = new ArrayBindingSet ( new IVariable<?> [] { x }, new IConstant [] { new Constant<String> ( "1" ) } ) ; + + assertTrue ( op.accept ( ne ) ) ; + assertFalse ( op.accept ( eq ) ) ; + assertTrue ( op.accept ( nb ) ) ; + } +} \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNEConstant.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNEConstant.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestNEConstant.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -29,6 +29,13 @@ import junit.framework.TestCase2; +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + /** * Unit tests for {@link NEConstant}. * @@ -50,8 +57,40 @@ super(name); } - public void test_something() { - fail("write tests"); + /** + * Unit test for {@link NEConstant#NEConstant(IVariable,IConstant)} + */ + public void testConstructor () + { + try { assertTrue ( null != new NEConstant ( null, new Constant<String> ( "1" ) ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != new NEConstant ( Var.var ( "x" ), null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + assertTrue ( null != new NEConstant ( Var.var ( "x" ), new Constant<String> ( "1" ) ) ) ; } - -} + + /** + * Unit test for {@link NEConstant#accept(IBindingSet)} + */ + public void testAccept () + { + Var<?> var = Var.var ( "x" ) ; + Constant<String> val1 = new Constant<String> ( "1" ) ; + Constant<String> val2 = new Constant<String> ( "2" ) ; + Constant<Integer> val3 = new Constant<Integer> ( 1 ) ; + + NEConstant op = new NEConstant ( var, val1 ) ; + + IBindingSet eq = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val1 } ) ; + IBindingSet ne1 = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val2 } ) ; + IBindingSet ne2 = new ArrayBindingSet ( new IVariable<?> [] { var }, new IConstant [] { val3 } ) ; + IBindingSet nb = new ArrayBindingSet ( new IVariable<?> [] {}, new IConstant [] {} ) ; + + assertFalse ( op.accept ( eq ) ) ; + assertTrue ( op.accept ( ne1 ) ) ; + assertTrue ( op.accept ( ne2 ) ) ; + assertTrue ( op.accept ( nb ) ) ; + } +} \ No newline at end of file Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestOR.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestOR.java 2010-09-27 14:29:21 UTC (rev 3635) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestOR.java 2010-09-27 16:12:12 UTC (rev 3636) @@ -29,6 +29,14 @@ import junit.framework.TestCase2; +import com.bigdata.bop.ArrayBindingSet; +import com.bigdata.bop.Constant; +import com.bigdata.bop.IBindingSet; +import com.bigdata.bop.IConstant; +import com.bigdata.bop.IConstraint; +import com.bigdata.bop.IVariable; +import com.bigdata.bop.Var; + /** * Unit tests for {@link OR}. * @@ -50,8 +58,44 @@ super(name); } - public void test_something() { - fail("write tests"); + /** + * Unit test for {@link OR#OR(IConstraint,IConstraint)} + */ + public void testConstructor () + { + IConstraint eq = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; + IConstraint ne = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; + + try { assertTrue ( null != new OR ( null, eq ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + try { assertTrue ( null != new OR ( eq, null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } + catch ( IllegalArgumentException e ) {} + + assertTrue ( null != new OR ( eq, ne ) ) ; } - -} + + /** + * Unit test for {@link OR#accept(IBindingSet)} + */ + public void testAccept () + { + Var<?> x = Var.var ( "x" ) ; + Var<?> y = Var.var ( "y" ) ; + Constant<Integer> val1 = new Constant<Integer> ( 1 ) ; + Constant<Integer> val2 = new Constant<Integer> ( 2 ) ; + + IConstraint eq = new EQ ( x, y ) ; + IConstraint eqc = new EQConstant ( y, val2 ) ; + + OR op = new OR ( eq, eqc ) ; + + IBindingSet eqlhs = new ArrayBindingSet ( new IVariable<?> [] { x, y }, new IConstant [] { val1, val1 } ) ; + IBindingSet eqrhs = new ArrayBindingSet ( new IVariable<?> [] { x, y }, new IConstant [] { val1, val2 } ) ; + IBindingSet ne = new ArrayBindingSet ( new IVariable<?> [] { x, y }, new IConstant [] { val2, val1 } ) ; + + assertTrue ( op.accept ( eqlhs ) ) ; + assertTrue ( op.accept ( eqrhs ) ) ; + assertFalse ( op.accept ( ne ) ) ; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <res...@us...> - 2010-09-27 14:29:31
|
Revision: 3635 http://bigdata.svn.sourceforge.net/bigdata/?rev=3635&view=rev Author: resendes Date: 2010-09-27 14:29:21 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Merge from maven_scaleout branch Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/test.xml branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/TestAll.java Removed Paths: ------------- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoringRemote.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarter.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarterRemote.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/config/ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/service/jini/AbstractServerTestCase.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/service/jini/PerformanceTest.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/service/jini/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/service/jini/TestBigdataClient.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/service/jini/TestBigdataClientRemote.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/zookeeper/ Property Changed: ---------------- branches/bbb_cleanup/ branches/bbb_cleanup/bigdata-core/ branches/bbb_cleanup/bigdata-core/bigdata-perf/ branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources/ branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL/ branches/bbb_cleanup/bigdata-core/dsi-utils/lib/ branches/bbb_cleanup/bigdata-core/dsi-utils/src/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/osgi/ branches/bbb_cleanup/bigdata-core/src/main/deploy/bin/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties branches/bbb_cleanup/bigdata-core/src/main/java/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util/ branches/bbb_cleanup/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config branches/bbb_cleanup/bigdata-core/src/test/java/ Property changes on: branches/bbb_cleanup ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3628 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3634 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core:3588-3628 /trunk:3499 + /branches/maven_scaleout/bigdata-core:3588-3634 /trunk:3499 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3628 /trunk/bigdata-perf:3379-3541 + /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3634 /trunk/bigdata-perf:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3628 /trunk/bigdata-perf/lubm/src/resources:3379-3541 + /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3634 /trunk/bigdata-perf/lubm/src/resources:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3628 /trunk/dsi-utils/LEGAL:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3634 /trunk/dsi-utils/LEGAL:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/lib ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3628 /trunk/dsi-utils/lib:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3634 /trunk/dsi-utils/lib:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3628 /trunk/dsi-utils/src:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3634 /trunk/dsi-utils/src:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3628 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3634 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3628 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3634 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/osgi ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/osgi:3588-3628 /trunk/osgi:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/osgi:3588-3634 /trunk/osgi:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/bin ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3628 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3634 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3628 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 + /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3634 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3634 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3628 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3634 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3628 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3634 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3628 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3634 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3628 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 + /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3634 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3628 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 + /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3634 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties:3588-3628 /trunk/bigdata-sails/src/samples/com/bigdata/samples/fastload.properties:3503 /trunk/src/samples-sail/com/bigdata/samples/fastload.properties:3499 + /branches/maven_scaleout/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties:3588-3634 /trunk/bigdata-sails/src/samples/com/bigdata/samples/fastload.properties:3503 /trunk/src/samples-sail/com/bigdata/samples/fastload.properties:3499 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3588-3628 /trunk/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/config/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3588-3628 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/config/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3588-3628 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/jini/start/testfed.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3588-3628 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2594-3237 /branches/dev-btm/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3463 /branches/fko/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3588-3634 /trunk/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Modified: branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/test.xml =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/test.xml 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/test.xml 2010-09-27 14:29:21 UTC (rev 3635) @@ -277,9 +277,6 @@ <test name="com.bigdata.search.TestAll" todir="${test.results.dir}" unless="testName" /> <test name="com.bigdata.relation.TestAll" todir="${test.results.dir}" unless="testName" /> - <!-- See https://sourceforge.net/apps/trac/bigdata/ticket/53 --> - <test name="com.bigdata.jini.TestAll" todir="${test.results.dir}" unless="testName" /> - <test name="com.bigdata.rdf.TestAll" todir="${test.results.dir}" unless="testName" /> <test name="com.bigdata.rdf.sail.TestAll" todir="${test.results.dir}" unless="testName" /> Property changes on: branches/bbb_cleanup/bigdata-core/src/test/java ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/java:2594-3237 /branches/dev-btm/bigdata/src/test:3463 /branches/dev-btm/bigdata-core/src/test/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test:3463 /branches/dev-btm/bigdata-rdf/src/test:3463 /branches/dev-btm/bigdata-sails/src/test:3463 /branches/fko/bigdata-core/src/test/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/java:3588-3628 /trunk/bigdata-core/src/test/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/test:3542 /trunk/bigdata-sails/src/test:3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/test/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/test/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/test/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/test/java:2594-3237 /branches/dev-btm/bigdata/src/test:3463 /branches/dev-btm/bigdata-core/src/test/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/test:3463 /branches/dev-btm/bigdata-rdf/src/test:3463 /branches/dev-btm/bigdata-sails/src/test:3463 /branches/fko/bigdata-core/src/test/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/test/java:3588-3634 /trunk/bigdata-core/src/test/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/test:3542 /trunk/bigdata-sails/src/test:3542 Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/TestAll.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/TestAll.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -113,8 +113,6 @@ suite.addTest( com.bigdata.relation.TestAll.suite() ); // suite.addTest( com.bigdata.service.mapReduce.TestAll.suite() ); - // Jini integration - suite.addTest(com.bigdata.jini.TestAll.suite()); // RDF suite.addTest(com.bigdata.rdf.TestAll.suite()); Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -1,95 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jun 26, 2006 - */ -package com.bigdata.jini; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import com.bigdata.service.jini.AbstractServerTestCase; - -/** - * Aggregates tests in dependency order. The service tests require that Jini is - * running, that you have specified a suitable security policy, etc. See - * {@link AbstractServerTestCase} for <strong>required</strong> system - * properties in order to run this test suite - * - * @version $Id$ - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - */ -public class TestAll extends TestCase { - - public TestAll() { - } - - public TestAll(String name) { - super(name); - } - - public static Test suite() { - - /* - * log4j defaults to DEBUG which will produce simply huge amounts of - * logging information when running the unit tests. Therefore we - * explicitly set the default logging level to WARN. If you are using a - * log4j configuration file then this is unlikely to interact with your - * configuration, and in any case you can override specific loggers. - */ - { - - final Logger log = Logger.getRootLogger(); - - if (log.getLevel().equals(Level.DEBUG)) { - - log.setLevel(Level.WARN); - - log - .warn("Defaulting debugging level to WARN for the unit tests"); - - } - - } - - final TestSuite suite = new TestSuite("jini"); - - // zookeeper client library (queues, locks, etc). - suite.addTest(com.bigdata.zookeeper.TestAll.suite()); - - // concrete impls of bigdata services using jini. - suite.addTest(com.bigdata.service.jini.TestAll.suite()); - - // bigdata services manager test suite. - suite.addTest(com.bigdata.jini.start.TestAll.suite()); - - return suite; - - } - -} Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -1,234 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 7, 2009 - */ - -package com.bigdata.jini.start; - -import java.io.File; -import java.util.List; -import java.util.UUID; - -import com.bigdata.DataFinder; -import junit.framework.TestCase2; -import net.jini.config.Configuration; -import net.jini.config.ConfigurationProvider; - -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.KeeperException.NodeExistsException; -import org.apache.zookeeper.ZooDefs.Ids; -import org.apache.zookeeper.data.ACL; - -import com.bigdata.jini.start.config.ZookeeperClientConfig; -import com.bigdata.jini.start.process.ProcessHelper; -import com.bigdata.jini.start.process.ZookeeperProcessHelper; -import com.bigdata.resources.ResourceFileFilter; -import com.bigdata.service.jini.JiniClient; -import com.bigdata.service.jini.JiniFederation; - -/** - * Abstract base class for unit tests requiring a running zookeeper and a - * running federation as configured from a test resource. - * <p> - * You MUST specify a security policy, e.g.: - * - * <pre> - * -Djava.security.policy=policy.all - * </pre> - * - * for these tests to run. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class AbstractFedZooTestCase extends TestCase2 { - - /** - * - */ - public AbstractFedZooTestCase() { - } - - /** - * @param arg0 - */ - public AbstractFedZooTestCase(String arg0) { - super(arg0); - } - - /** - * A configuration file used by some of the unit tests in this package. - */ - protected final String configFile = DataFinder.bestURI("testing/data/com/bigdata/jini/start/testfed.config").toASCIIString(); - - // ACL used for the unit tests. - protected final List<ACL> acl = Ids.OPEN_ACL_UNSAFE; - - Configuration config; - - final protected MockListener listener = new MockListener(); - - JiniFederation fed; - - String zrootname = null; - - public void setUp() throws Exception { - - zrootname = getName() + "_" + UUID.randomUUID(); - - if (new File(zrootname).exists()) { - // clean out old files. - recursiveDelete(new File(zrootname)); - } - - // a unique zroot in the /test namespace. - final String zroot = "/"+zrootname;//"/test/" + zrootname; - - System.err.println(getName() + ": setting up zrootname=" + zrootname); - - final String[] args = new String[] { configFile, - // Note: overrides the zroot to be unique. - ZookeeperClientConfig.Options.NAMESPACE + "." - + ZookeeperClientConfig.Options.ZROOT + "=" + "\"" - + zroot + "\"" , -// // Override the federation name. -// "bigdata.fedname=\""+fedname+"\"" - }; - - // apply the federation name to the configuration file. - System.setProperty("bigdata.zrootname", zrootname); - - config = ConfigurationProvider.getInstance(args); - - // if necessary, start zookeeper (a server instance). - ZookeeperProcessHelper.startZookeeper(config, listener); - - /* - * FIXME We need to start a jini lookup service for groups = {fedname} - * for this test to succeed. - */ - - fed = JiniClient.newInstance(args).connect(); - - /* - * Create the federation zroot and config znodes. - */ - final ZooKeeper zookeeper = fed.getZookeeper(); - - // make sure that we have the zroot that we overrode above. - assertEquals(zroot, fed.getZooConfig().zroot); - - fed.createKeyZNodes(zookeeper); - - } - - public void tearDown() throws Exception { - - System.err.println(getName() + ": tearing down zrootname=" + zrootname); - - // destroy any processes started by this test suite. - for (ProcessHelper t : listener.running) { - - t.kill(true/*immediateShutdown*/); - - } - - if (fed != null) { - - /* - * @todo if we do this to kill zk then we must ensure that a private - * instance was started on the desired port. That means an override - * for the configuration file and an unused port assigned for the - * client and peers on the zk instance started for this unit test. - */ -// ZooHelper.kill(clientPort); - - fed.shutdownNow(); - - } - - if (zrootname != null && new File(zrootname).exists()) { - - /* - * Wait a bit and then try and delete the federation directory - * structure. - */ - - try { - Thread.sleep(250); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - - recursiveDelete(new File(zrootname)); - - } - - } - - /** - * Recursively removes any files and subdirectories and then removes the - * file (or directory) itself. - * <p> - * Note: Files that are not recognized will be logged by the - * {@link ResourceFileFilter}. - * - * @param f - * A file or directory. - */ - private void recursiveDelete(final File f) { - - if (f.isDirectory()) { - - final File[] children = f.listFiles(); - - if (children == null) { - - // The directory does not exist. - return; - - } - - for (int i = 0; i < children.length; i++) { - - recursiveDelete(children[i]); - - } - - } - - if(log.isInfoEnabled()) - log.info("Removing: " + f); - - if (f.exists() && !f.delete()) { - - log.warn("Could not remove: " + f); - - } - - } - -} Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -1,111 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 10, 2009 - */ - -package com.bigdata.jini.start; - -import java.rmi.RemoteException; - -//BTM import com.bigdata.service.IService; -import com.bigdata.service.jini.JiniClient; -import com.bigdata.service.jini.JiniFederation; -import com.bigdata.service.jini.RemoteDestroyAdmin; -import com.bigdata.service.jini.TransactionServer; - -//BTM -import com.bigdata.journal.TransactionService; -import com.sun.jini.admin.DestroyAdmin; -import net.jini.admin.Administrable; - -/** - * Destroys a specific service - the {@link TransactionServer}. This is for use - * in testing the behavior of the {@link ServicesManagerServer} and the behavior - * of the other services in the federation when the {@link TransactionServer} is - * lost. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class DestroyTransactionService { - - /** - * @param args - * Configuration file and optional overrides. - * - * @throws InterruptedException - * @throws RemoteException - */ - public static void main(String[] args) throws InterruptedException, - RemoteException { - - JiniFederation fed = JiniClient.newInstance(args).connect(); - - try { - -//BTM IService service = fed.getTransactionService(); -TransactionService service = fed.getTransactionService(); - - if (service == null) { - - System.err.println("Service not found."); - - } else { -if(service instanceof RemoteDestroyAdmin) { - ((RemoteDestroyAdmin) service).destroy(); - System.err.println("destroyed transaction service [remote implementation]"); -} else if(service instanceof Administrable) { - try { - Object serviceAdmin = ((Administrable)service).getAdmin(); - if(serviceAdmin instanceof DestroyAdmin) { - try { - ((DestroyAdmin)serviceAdmin).destroy(); - System.err.println("destroyed transaction service [smart proxy implementation]"); - } catch(Throwable t) { - System.err.println("ERROR: exception while destroying transaction service ["+t+"]"); - } - } else { - System.err.println("FAILURE: transaction service admin not instance of DestroyAdmin"); - } - } catch(Throwable t) { - System.err.println("ERROR: exception from call to getAdmin while destroying transaction service ["+t+"]"); - } -} else { - System.err.println("FAILURE: transaction service not instance of Administrable"); -} - -//BTM System.err.println("Service destroyed."); - - } - - } finally { - - fed.shutdown(); - - } - - } - -} Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -1,44 +0,0 @@ -package com.bigdata.jini.start; - -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.apache.log4j.Logger; - -import com.bigdata.jini.start.process.ProcessHelper; - -/** - * Mock implementation used by some unit tests. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class MockListener implements IServiceListener { - - protected static final Logger log = Logger.getLogger(MockListener.class); - - protected static final boolean INFO = log.isInfoEnabled(); - - protected static final boolean DEBUG = log.isDebugEnabled(); - - public Queue<ProcessHelper> running = new ConcurrentLinkedQueue<ProcessHelper>(); - - public void add(ProcessHelper service) { - - if (INFO) - log.info("adding: " + service); - - running.add(service); - - } - - public void remove(ProcessHelper service) { - - if (INFO) - log.info("removing: " + service); - - running.remove(service); - - } - -} Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java 2010-09-27 13:44:37 UTC (rev 3634) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java 2010-09-27 14:29:21 UTC (rev 3635) @@ -1,72 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jun 26, 2006 - */ -package com.bigdata.jini.start; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import com.bigdata.jini.start.config.TestZookeeperServerEntry; -import com.bigdata.service.jini.AbstractServerTestCase; - -/** - * Aggregates tests in dependency order - see {@link AbstractServerTestCase} for - * <strong>required</strong> system properties in order to run this test suite. - * - * @version $Id$ - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - */ -public class TestAll extends TestCase { - - public TestAll() { - } - - public TestAll(String name) { - super(name); - } - - public static Test suite() { - - final TestSuite suite = new TestSuite("start"); - - // - suite.addTestSuite(TestServiceConfigurationZNodeEnum.class); - - // test suite for parsi... [truncated message content] |
From: <res...@us...> - 2010-09-27 13:44:44
|
Revision: 3634 http://bigdata.svn.sourceforge.net/bigdata/?rev=3634&view=rev Author: resendes Date: 2010-09-27 13:44:37 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Added more test cases and cleanup for com.bigdata.util package. Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/EntryUtil.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java Added Paths: ----------- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/EntryUtil.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/EntryUtil.java 2010-09-27 13:39:12 UTC (rev 3633) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/EntryUtil.java 2010-09-27 13:44:37 UTC (rev 3634) @@ -75,7 +75,7 @@ * type. If no element in the array is an instance of the given * type, then <code>null</code> is returned. */ - public static <T> T getEntryByType(Entry[] attrs, Class<T> type) + public static <T extends Entry> T getEntryByType(Entry[] attrs, Class<T> type) { if( (attrs == null) || (type == null) ) return null; for(int i=0; i<attrs.length; i++) { @@ -85,144 +85,144 @@ return null; }//end getEntryByType - /** - * Examines the given array of entries and returns an array of all - * elements that are an instance of the given class type. If no element in - * the array is an instance of the given type, then <code>null</code> is - * returned. - */ - public static <T> T[] getEntriesByType(Entry[] attrs, Class<T> type) - { - if( (attrs == null) || (type == null) ) return null; - ArrayList<T> matches = null; - for(int i=0; i<attrs.length; i++) { - if( !( type.isInstance(attrs[i]) ) ) continue; - if ( matches == null ) - matches = new ArrayList<T>(); - matches.add( (T)attrs[i] ); - }//end loop +// /** +// * Examines the given array of entries and returns an array of all +// * elements that are an instance of the given class type. If no element in +// * the array is an instance of the given type, then <code>null</code> is +// * returned. +// */ +// public static <T> T[] getEntriesByType(Entry[] attrs, Class<T> type) +// { +// if( (attrs == null) || (type == null) ) return null; +// ArrayList<T> matches = null; +// for(int i=0; i<attrs.length; i++) { +// if( !( type.isInstance(attrs[i]) ) ) continue; +// if ( matches == null ) +// matches = new ArrayList<T>(); +// matches.add( (T)attrs[i] ); +// }//end loop +// +// if ( matches == null ) return null; +// +// return matches.toArray +// ( (T[])java.lang.reflect.Array.newInstance +// ( type, matches.size() ) ); +// } - if ( matches == null ) return null; +// /** +// * Examines the given array of entries and returns a list of all +// * elements that are an instance of the given class type. If no element +// * in the array is an instance of the given type, then an empty list is +// * returned. +// */ +// public static <T> List<T> getEntryListByType(final Entry[] attrs, +// final Class<T> type) +// { +// if(attrs == null) { +// throw new NullPointerException("null attrs array"); +// } +// if(type == null) { +// throw new NullPointerException("null type"); +// } +// final List<T> matches = new ArrayList<T>(); +// for (final Entry attr : attrs) { +// if(type.isInstance(attr)){ +// matches.add(type.cast(attr)); +// } +// } +// return matches; +// } - return matches.toArray - ( (T[])java.lang.reflect.Array.newInstance - ( type, matches.size() ) ); - } +// /** +// * Examines the given array of entries and returns a list of all +// * elements that match the given <code>template</code>; where +// * the matching semantics are defined by the template-matching +// * semantics specified in the Lookup Service Specification. If no +// * element in the given array matches the template, then an empty +// * list is returned. +// */ +// public static <T extends Entry> List<T> getEntryList(final Entry[] attrs, +// final T template) +// { +// final List<T> matches = new ArrayList<T>(); +// for (final Entry attr : attrs) { +// if(LookupAttributes.matches(template, attr)){ +// matches.add((T) attr); +// } +// } +// return matches; +// } - /** - * Examines the given array of entries and returns a list of all - * elements that are an instance of the given class type. If no element - * in the array is an instance of the given type, then an empty list is - * returned. - */ - public static <T> List<T> getEntryListByType(final Entry[] attrs, - final Class<T> type) - { - if(attrs == null) { - throw new NullPointerException("null attrs array"); - } - if(type == null) { - throw new NullPointerException("null type"); - } - final List<T> matches = new ArrayList<T>(); - for (final Entry attr : attrs) { - if(type.isInstance(attr)){ - matches.add(type.cast(attr)); - } - } - return matches; - } +// /** +// * Using the given <code>Logger</code>, displays the contents +// * of the given array of entries. +// */ +// public static void displayEntrySet(Entry[] entries, Logger logger) { +// displayEntrySet(null, entries, null, logger); +// } - /** - * Examines the given array of entries and returns a list of all - * elements that match the given <code>template</code>; where - * the matching semantics are defined by the template-matching - * semantics specified in the Lookup Service Specification. If no - * element in the given array matches the template, then an empty - * list is returned. - */ - public static <T extends Entry> List<T> getEntryList(final Entry[] attrs, - final T template) - { - final List<T> matches = new ArrayList<T>(); - for (final Entry attr : attrs) { - if(LookupAttributes.matches(template, attr)){ - matches.add((T) attr); - } - } - return matches; - } +// /** +// * Using the given <code>Logger</code>, displays the contents +// * of the given array of entries. +// * <p> +// * Additionally, the identification of the output can be +// * customized using the given <code>entrySetName</code>. +// */ +// public static void displayEntrySet(Entry[] entries, +// String entrySetName, +// Logger logger) +// { +// displayEntrySet(null, entries, entrySetName, logger); +// } - /** - * Using the given <code>Logger</code>, displays the contents - * of the given array of entries. - */ - public static void displayEntrySet(Entry[] entries, Logger logger) { - displayEntrySet(null, entries, null, logger); - } +// /** +// * Using the given <code>Logger</code>, displays the contents +// * of the given array of entries. +// * <p> +// * Each line displayed is prefixed using the value of the +// * <code>prefix</code> parameter. +// */ +// public static void displayEntrySet(String prefix, +// Entry[] entries, +// Logger logger) +// { +// displayEntrySet(prefix, entries, null, logger); +// } - /** - * Using the given <code>Logger</code>, displays the contents - * of the given array of entries. - * <p> - * Additionally, the identification of the output can be - * customized using the given <code>entrySetName</code>. - */ - public static void displayEntrySet(Entry[] entries, - String entrySetName, - Logger logger) - { - displayEntrySet(null, entries, entrySetName, logger); - } +// /** +// * Using the given <code>Logger</code>, displays the contents +// * of the given array of entries. +// * <p> +// * Each line displayed is prefixed using the value of the +// * <code>prefix</code> parameter. Additionally, the identification +// * of the output can be customized using the given +// * <code>entrySetName</code>. +// */ +// public static void displayEntrySet(String prefix, +// Entry[] entries, +// String entrySetName, +// Logger logger) +// { +// if ( logger.isDebugEnabled() ) { +// if(prefix == null) prefix = ""; +// String name = ((entrySetName == null) ? +// "Entry Set" : entrySetName); +// if(entries == null) { +// logger.debug(prefix+": "+name+" = null"); +// } else if(entries.length <= 0) { +// logger.debug(prefix+": "+name+" = NO_ENTRIES"); +// } else { +// logger.debug(prefix+": "+name); +// logger.debug(prefix+": " +// +"-- Number of Entries = " + entries.length); +// for(int i=0; i<entries.length; i++) { +// displayEntry(entries[i], "", logger); +// }//end loop +// }//endif +// } +// } /** - * Using the given <code>Logger</code>, displays the contents - * of the given array of entries. - * <p> - * Each line displayed is prefixed using the value of the - * <code>prefix</code> parameter. - */ - public static void displayEntrySet(String prefix, - Entry[] entries, - Logger logger) - { - displayEntrySet(prefix, entries, null, logger); - } - - /** - * Using the given <code>Logger</code>, displays the contents - * of the given array of entries. - * <p> - * Each line displayed is prefixed using the value of the - * <code>prefix</code> parameter. Additionally, the identification - * of the output can be customized using the given - * <code>entrySetName</code>. - */ - public static void displayEntrySet(String prefix, - Entry[] entries, - String entrySetName, - Logger logger) - { - if ( logger.isDebugEnabled() ) { - if(prefix == null) prefix = ""; - String name = ((entrySetName == null) ? - "Entry Set" : entrySetName); - if(entries == null) { - logger.debug(prefix+": "+name+" = null"); - } else if(entries.length <= 0) { - logger.debug(prefix+": "+name+" = NO_ENTRIES"); - } else { - logger.debug(prefix+": "+name); - logger.debug(prefix+": " - +"-- Number of Entries = " + entries.length); - for(int i=0; i<entries.length; i++) { - displayEntry(entries[i], "", logger); - }//end loop - }//endif - } - } - - /** * Using the given <code>Logger</code>, displays the contents of * the given <code>entry</code>: Class, class loader, fields. */ @@ -230,19 +230,19 @@ displayEntry(null, entry, null, logger); } - /** - * Using the given <code>Logger</code>, displays the contents of - * the given <code>entry</code>: Class, class loader, fields. - * <p> - * Each line displayed is prefixed using the value of the - * <code>prefix</code> parameter. - */ - public static void displayEntry(String prefix, - Entry entry, - Logger logger) - { - displayEntry(prefix, entry, null, logger); - } +// /** +// * Using the given <code>Logger</code>, displays the contents of +// * the given <code>entry</code>: Class, class loader, fields. +// * <p> +// * Each line displayed is prefixed using the value of the +// * <code>prefix</code> parameter. +// */ +// public static void displayEntry(String prefix, +// Entry entry, +// Logger logger) +// { +// displayEntry(prefix, entry, null, logger); +// } /** * Using the given <code>Logger</code>, displays the contents of @@ -271,7 +271,7 @@ String label, Logger logger) { - if ( logger.isDebugEnabled() ) + if ( logger!= null && logger.isDebugEnabled() ) { if(prefix == null) prefix = ""; if(label == null) label = ""; @@ -305,80 +305,80 @@ } } - /** - * Using the given <code>Logger</code>, displays fields of the given - * <code>entry</code> instances that are not equal. Each line displayed - * is prefixed using the value of the <code>prefix</code> parameter. - */ - public static void displayDiff(String prefix, - Entry entry1, - Entry entry2, - Logger logger) - { - if ( logger.isDebugEnabled() ) { - if(prefix == null) prefix = ""; +// /** +// * Using the given <code>Logger</code>, displays fields of the given +// * <code>entry</code> instances that are not equal. Each line displayed +// * is prefixed using the value of the <code>prefix</code> parameter. +// */ +// public static void displayDiff(String prefix, +// Entry entry1, +// Entry entry2, +// Logger logger) +// { +// if ( logger.isDebugEnabled() ) { +// if(prefix == null) prefix = ""; +// +// String e1Str = (entry1 == null ? +// null : (entry1.getClass()).getName() ); +// String e2Str = (entry2 == null ? +// null : (entry2.getClass()).getName() ); +// +// Map<Field, List> diffMap = diff(entry1, entry2); +// +// if(diffMap == null) { +// logger.log(Level.DEBUG, prefix+": " +// +"CANNOT BE COMPARED: [entry1="+e1Str+"], " +// +"[entry2="+e2Str+"]"); +// return; +// }//endif +// +// if(diffMap.size() == 0) { +// logger.log(Level.DEBUG, prefix+": " +// +"NO DIFFERENCE: [entry1="+e1Str+"], " +// +"[entry2="+e2Str+"]"); +// return; +// }//endif +// +// Set<Map.Entry<Field, List>> fieldSet = diffMap.entrySet(); +// Iterator<Map.Entry<Field, List>> fieldItr = fieldSet.iterator(); +// while( fieldItr.hasNext() ) { +// Map.Entry<Field, List> pair = fieldItr.next(); +// Field field = pair.getKey(); +// List vals = pair.getValue(); +// String fieldName = field.getName(); +// if(vals.size() != 2) {//shouldn't happen +// logger.log(Level.WARN, "UNEXPECTED ERROR: " +// +"number of field values != 2 [field="+fieldName +// +", # of values="+vals.size()+", " +// +"vals="+vals+"]"); +// }//endif +// Object val1 = vals.get(0); +// Object val2 = vals.get(1); +// logger.log(Level.DEBUG, prefix+": " +// +e1Str+"."+fieldName+" = "+val1+" --> "+val2); +// }//end loop +// }//end(logger.isDebugEnabled) +// +// } - String e1Str = (entry1 == null ? - null : (entry1.getClass()).getName() ); - String e2Str = (entry2 == null ? - null : (entry2.getClass()).getName() ); +// public static void displayDiff(Entry entry1, Entry entry2, Logger logger) { +// displayDiff(null, entry1, entry2, logger); +// } - Map<Field, List> diffMap = diff(entry1, entry2); +// /** +// * Compares for equivalence, the contents of two individual entries. +// */ +// public static boolean compareEntries(Entry entry1, +// Entry entry2) +// { +// return ( compareEntrySets(null, +// new Entry[] {entry1}, +// new Entry[] {entry2}, +// null) ); +// } - if(diffMap == null) { - logger.log(Level.DEBUG, prefix+": " - +"CANNOT BE COMPARED: [entry1="+e1Str+"], " - +"[entry2="+e2Str+"]"); - return; - }//endif - - if(diffMap.size() == 0) { - logger.log(Level.DEBUG, prefix+": " - +"NO DIFFERENCE: [entry1="+e1Str+"], " - +"[entry2="+e2Str+"]"); - return; - }//endif - - Set<Map.Entry<Field, List>> fieldSet = diffMap.entrySet(); - Iterator<Map.Entry<Field, List>> fieldItr = fieldSet.iterator(); - while( fieldItr.hasNext() ) { - Map.Entry<Field, List> pair = fieldItr.next(); - Field field = pair.getKey(); - List vals = pair.getValue(); - String fieldName = field.getName(); - if(vals.size() != 2) {//shouldn't happen - logger.log(Level.WARN, "UNEXPECTED ERROR: " - +"number of field values != 2 [field="+fieldName - +", # of values="+vals.size()+", " - +"vals="+vals+"]"); - }//endif - Object val1 = vals.get(0); - Object val2 = vals.get(1); - logger.log(Level.DEBUG, prefix+": " - +e1Str+"."+fieldName+" = "+val1+" --> "+val2); - }//end loop - }//end(logger.isDebugEnabled) - - } - - public static void displayDiff(Entry entry1, Entry entry2, Logger logger) { - displayDiff(null, entry1, entry2, logger); - } - /** * Compares for equivalence, the contents of two individual entries. - */ - public static boolean compareEntries(Entry entry1, - Entry entry2) - { - return ( compareEntrySets(null, - new Entry[] {entry1}, - new Entry[] {entry2}, - null) ); - } - - /** - * Compares for equivalence, the contents of two individual entries. * <p> * Any lines displayed during the comparision will be displayed * using the given <code>Logger</code>. @@ -393,50 +393,50 @@ logger) ); } - /** - * Compares for equivalence, the contents of two individual entries. - * <p> - * Any lines displayed during the comparision will be displayed - * using the given <code>Logger</code>, and will be prefixed using - * the value of the <code>prefix</code> parameter. - */ - public static boolean compareEntries(String prefix, - Entry entry1, - Entry entry2, - Logger logger) - { - return ( compareEntrySets(prefix, - new Entry[] {entry1}, - new Entry[] {entry2}, - logger) ); - } +// /** +// * Compares for equivalence, the contents of two individual entries. +// * <p> +// * Any lines displayed during the comparision will be displayed +// * using the given <code>Logger</code>, and will be prefixed using +// * the value of the <code>prefix</code> parameter. +// */ +// public static boolean compareEntries(String prefix, +// Entry entry1, +// Entry entry2, +// Logger logger) +// { +// return ( compareEntrySets(prefix, +// new Entry[] {entry1}, +// new Entry[] {entry2}, +// logger) ); +// } /* ***************************************************************** */ /* ************************ compareEntrySets *********************** */ /* ***************************************************************** */ - /** - * Compares for equivalence, the contents of two sets of entries - * ignoring duplicate entries. - */ - public static boolean compareEntrySets(Entry[] entrySet1, - Entry[] entrySet2) - { - return compareEntrySets(null, entrySet1, entrySet2, null); - } +// /** +// * Compares for equivalence, the contents of two sets of entries +// * ignoring duplicate entries. +// */ +// public static boolean compareEntrySets(Entry[] entrySet1, +// Entry[] entrySet2) +// { +// return compareEntrySets(null, entrySet1, entrySet2, null); +// } - /** - * Compares for equivalence, the contents of two sets of entries - * ignoring duplicate entries. - * <p> - * Any lines displayed during the comparision will be displayed - * using the given <code>Logger</code>. - */ - public static boolean compareEntrySets(Entry[] entrySet1, - Entry[] entrySet2, - Logger logger) - { - return compareEntrySets(null, entrySet1, entrySet2, logger); - } +// /** +// * Compares for equivalence, the contents of two sets of entries +// * ignoring duplicate entries. +// * <p> +// * Any lines displayed during the comparision will be displayed +// * using the given <code>Logger</code>. +// */ +// public static boolean compareEntrySets(Entry[] entrySet1, +// Entry[] entrySet2, +// Logger logger) +// { +// return compareEntrySets(null, entrySet1, entrySet2, logger); +// } /** * Compares for equivalence, the contents of two sets of entries @@ -467,7 +467,7 @@ logger.trace(prefix+": entrySet1 = " +"null, entrySet2 != null"); }//endif - return false; + return false; }//endif } else {//entrySet1 != null if(entrySet2 == null) { @@ -475,7 +475,7 @@ logger.trace(prefix+": entrySet1 != " +"null, entrySet2 == null"); }//endif - return false; + return false; }//endif }//endif @@ -546,10 +546,10 @@ +": entries left over from comparison loop, " + "entry sets not equal"); }//endif - return false; + return false; }//endif - return true; + return true; } /** Returns public, non-static, non-transient, non-final fields contained @@ -708,255 +708,255 @@ } } - /** - * Convenience method that, given two <code>Entry</code> instances that - * are of the <i>same type</i>, determines which of the corresponding - * public fields of the given <code>Entry</code> instances are not equal, - * and returns a <code>Map</code> in which each key-value pair contains - * a key represented by the <code>Field</code> being compared, and a - * corresponding value represented by a <code>List</code> whose - * elements are the two values of the fields being compared; where the - * first element of the <code>List</code> is the value of the field - * in the first given <code>Entry</code>, and the second element of - * the <code>List</code> is the value of the field in the second - * <code>Entry</code> parameter. - * <p> - * If the <code>Entry</code> values input to this method are not the - * same type, then <code>null</code> is returned. If <code>null</code> - * is input for either or both of the <code>Entry</code> instances, - * then <code>null</code> is also returned. Finally, if the value of - * each public field of the first parameter equals the value of the - * corresponding field of the second parameter, then an empty - * <code>Map</code> is returned. - */ - public static Map<Field, List> diff(Entry e1, Entry e2) { - if (e1 == null || e2 == null) return null; - if (e1.getClass() != e2.getClass()) return null;//must be same type +// /** +// * Convenience method that, given two <code>Entry</code> instances that +// * are of the <i>same type</i>, determines which of the corresponding +// * public fields of the given <code>Entry</code> instances are not equal, +// * and returns a <code>Map</code> in which each key-value pair contains +// * a key represented by the <code>Field</code> being compared, and a +// * corresponding value represented by a <code>List</code> whose +// * elements are the two values of the fields being compared; where the +// * first element of the <code>List</code> is the value of the field +// * in the first given <code>Entry</code>, and the second element of +// * the <code>List</code> is the value of the field in the second +// * <code>Entry</code> parameter. +// * <p> +// * If the <code>Entry</code> values input to this method are not the +// * same type, then <code>null</code> is returned. If <code>null</code> +// * is input for either or both of the <code>Entry</code> instances, +// * then <code>null</code> is also returned. Finally, if the value of +// * each public field of the first parameter equals the value of the +// * corresponding field of the second parameter, then an empty +// * <code>Map</code> is returned. +// */ +// public static Map<Field, List> diff(Entry e1, Entry e2) { +// if (e1 == null || e2 == null) return null; +// if (e1.getClass() != e2.getClass()) return null;//must be same type +// +// Map<Field, List> retMap = new LinkedHashMap<Field, List>(); +// +// if (e1 == e2) return retMap; +// +// // compare each field +// Field[] fieldsArray1 = getFieldInfo(e1);//returns public fields +// Field[] fieldsArray2 = getFieldInfo(e2);//returns public fields +// try { +// for(int i=0; i<fieldsArray1.length; i++) { +// +// Field field1 = fieldsArray1[i]; +// Field field2 = fieldsArray2[i]; +// +// Object f1 = field1.get(e1);//value of field1 +// Object f2 = field2.get(e2);//value of field2 +// +// List fieldVals = new ArrayList(); +// +// if(f2 == f1) continue;//same obj or both null, f1 == f2, skip +// +// if(f2 == null || f1 == null) {//only 1 is null, f1 != f2 +// fieldVals.add(f1); +// fieldVals.add(f2); +// retMap.put(field1, fieldVals); +// continue;//next field +// }//endif +// +// if( !f2.equals(f1) ) {//test for arrays +// Class f2Class = f2.getClass(); +// Class f1Class = f1.getClass(); +// if( f2Class.isArray() && f1Class.isArray() ) { +// //determine if they are Object or primitive arrays +// Class f2Type = f2Class.getComponentType(); +// Class f1Type = f1Class.getComponentType(); +// +// if( !f2Type.equals(f1Type) ) {//field types not equal +// fieldVals.add(f1); +// fieldVals.add(f2); +// retMap.put(field1, fieldVals); +// continue;//next field +// }//endif +// +// boolean equalArrays = false; +// if( !f2Type.isPrimitive() && !f1Type.isPrimitive() ) { +// +// //types are equal & both non-primitive, use Object +// equalArrays = +// Arrays.equals( (Object[])f2, (Object[])f1 ); +// +// } else if(f2Type.isPrimitive()&&f1Type.isPrimitive()){ +// +// //types are equal & both primitive, use primitive +// if( f2Type.equals(Boolean.TYPE) ) { +// equalArrays = Arrays.equals( (boolean[])f2, +// (boolean[])f1 ); +// } else if( f2Type.equals(Character.TYPE) ) { +// equalArrays = Arrays.equals( (char[])f2, +// (char[])f1 ); +// } else if( f2Type.equals(Byte.TYPE) ) { +// equalArrays = Arrays.equals( (byte[])f2, +// (byte[])f1 ); +// } else if( f2Type.equals(Short.TYPE) ) { +// equalArrays = Arrays.equals( (short[])f2, +// (short[])f1 ); +// } else if( f2Type.equals(Integer.TYPE) ) { +// equalArrays = Arrays.equals( (int[])f2, +// (int[])f1 ); +// } else if( f2Type.equals(Long.TYPE) ) { +// equalArrays = Arrays.equals( (long[])f2, +// (long[])f1 ); +// } else if( f2Type.equals(Float.TYPE) ) { +// equalArrays = Arrays.equals( (float[])f2, +// (float[])f1 ); +// } else if( f2Type.equals(Double.TYPE) ) { +// equalArrays = Arrays.equals( (double[])f2, +// (double[])f1 ); +// }//endif +// +// //else 1 primitive, 1 not primitive ==> !equalArrays +// +// }//endif +// +// if( !equalArrays ) {//f1 not equal f2 +// fieldVals.add(f1); +// fieldVals.add(f2); +// retMap.put(field1, fieldVals); +// continue;//next field +// }//endif +// +// continue;//f1 equals f2, skip it and go to next field +// +// }//endif( f2Class.isArray() && f1Class.isArray() ) +// +// //(not arrays && !f2.equals(f1)) +// fieldVals.add(f1); +// fieldVals.add(f2); +// retMap.put(field1, fieldVals); +// +// }//endif( !f2.equals(f1) ) +// +// }//end loop +// +// return retMap; +// +// } catch (IllegalAccessException e) { +// // should never happen, all entry fields are public +// throw new AssertionError(e); +// } +// } - Map<Field, List> retMap = new LinkedHashMap<Field, List>(); +// /** +// * Convenience method that, given two <code>Entry</code> instances, +// * copies the values of the <i>usable</i> (<code>public</code>, +// * non-<code>transient</code>, non-<code>static</code>, +// * non-<code>final</code>) fields of the first <code>Entry</code> +// * parameter to the usable fields of the same name to the second given +// * <code>Entry</code> parameter. Any usable field from one of the +// * parameters that does not have a counterpart in the other parameter +// * will be by passed. This method can be useful, for example, when +// * converting an <code>AcinionAttribute</code> to a parallel +// * <code>AcinionEvent</code> for reporting outside of the system. +// * If <code>null</code> is input for either parameter, then +// * <code>null</code> is returned. +// */ +// public static Entry copyEntry(Entry e1, Entry e2, Logger logger) { +// if (e1 == null || e2 == null) return null; +// Entry retEntry = e2; +// String e1Name = (e1.getClass()).getSimpleName(); +// String retEntryName = (retEntry.getClass()).getSimpleName(); +// +// Field[] e1Fields = EntryUtil.getFieldInfo(e1); +// Field[] retEntryFields = EntryUtil.getFieldInfo(retEntry); +// if( e1Fields == null || e1Fields.length == 0 ) return null; +// if( retEntryFields == null || retEntryFields.length == 0 ) return null; +// for(int i=0; i<e1Fields.length; i++) { +// Field e1Field = e1Fields[i]; +// String e1FieldName = e1Field.getName(); +// for(int j=0; j<retEntryFields.length; j++) { +// Field retEntryField = retEntryFields[j]; +// String retEntryFieldName = retEntryField.getName(); +// String errStr = (logger == null ? null : +// "cannot set " +// +retEntryName+"."+retEntryFieldName +// +" to value of " +// +e1Name+"."+e1FieldName ); +// if( e1FieldName.equals(retEntryFieldName) ) { +// try { +// retEntryField.set( retEntry, e1Field.get(e1) ); +// } catch(IllegalArgumentException e) { +// if(logger != null) logger.log(Level.WARN, errStr); +// e.printStackTrace(); +// } catch(IllegalAccessException e) { +// if(logger != null) logger.log(Level.WARN, errStr); +// e.printStackTrace(); +// } +// }//endif +// }//end loop(j) +// }//end loop(i) +// return retEntry; +// } - if (e1 == e2) return retMap; +// /** +// * Returns an instance of the given <code>Entry</code> class with +// * all <i>usable</i> (public, non-static, non-transient, non-final) +// * fields set to <code>null</code>. The object returned by this method +// * can be used as a template that will match any <code>Entry</code> +// * that is of the same type as the <code>Entry</code> input to this +// * method. +// * +// * This method can be useful when working with an <code>Entry</code> +// * instance that defines a no-arg constructor that sets one or more +// * of its fields to a non-<code>null</code> value. +// */ +// public static Entry wildcardAll(Entry entry) { +// try { +// Class realClass = entry.getClass(); +// Entry template = (Entry) realClass.newInstance(); +// +// Field[] f = realClass.getFields(); +// for(int i = 0; i < f.length; i++) { +// if(! usableField(f[i])) continue; +// f[i].set(template, null); +// }//end loop +// return template; +// } catch (Throwable t) { +// Logger.getLogger(EntryUtil.class).error("wildcardEntry failed", t); +// } +// return null; +// } - // compare each field - Field[] fieldsArray1 = getFieldInfo(e1);//returns public fields - Field[] fieldsArray2 = getFieldInfo(e2);//returns public fields - try { - for(int i=0; i<fieldsArray1.length; i++) { +// /** +// * Returns a clone of the given {@link Entry}. +// * (From com.sun.jini.example.browser.ServiceEditor.) +// */ +// public static Entry cloneEntry(Entry attr) { +// try { +// Class realClass = attr.getClass(); +// Entry template = (Entry) realClass.newInstance(); +// +// Field[] f = realClass.getFields(); +// for(int i = 0; i < f.length; i++) { +// if(! usableField(f[i])) +// continue; +// f[i].set(template, f[i].get(attr)); +// } +// +// return template; +// } catch (Throwable t) { +// Logger.getLogger(EntryUtil.class).error("duplicating entry failed", t); +// } +// return null; +// } - Field field1 = fieldsArray1[i]; - Field field2 = fieldsArray2[i]; - - Object f1 = field1.get(e1);//value of field1 - Object f2 = field2.get(e2);//value of field2 - - List fieldVals = new ArrayList(); - - if(f2 == f1) continue;//same obj or both null, f1 == f2, skip - - if(f2 == null || f1 == null) {//only 1 is null, f1 != f2 - fieldVals.add(f1); - fieldVals.add(f2); - retMap.put(field1, fieldVals); - continue;//next field - }//endif - - if( !f2.equals(f1) ) {//test for arrays - Class f2Class = f2.getClass(); - Class f1Class = f1.getClass(); - if( f2Class.isArray() && f1Class.isArray() ) { - //determine if they are Object or primitive arrays - Class f2Type = f2Class.getComponentType(); - Class f1Type = f1Class.getComponentType(); - - if( !f2Type.equals(f1Type) ) {//field types not equal - fieldVals.add(f1); - fieldVals.add(f2); - retMap.put(field1, fieldVals); - continue;//next field - }//endif - - boolean equalArrays = false; - if( !f2Type.isPrimitive() && !f1Type.isPrimitive() ) { - - //types are equal & both non-primitive, use Object - equalArrays = - Arrays.equals( (Object[])f2, (Object[])f1 ); - - } else if(f2Type.isPrimitive()&&f1Type.isPrimitive()){ - - //types are equal & both primitive, use primitive - if( f2Type.equals(Boolean.TYPE) ) { - equalArrays = Arrays.equals( (boolean[])f2, - (boolean[])f1 ); - } else if( f2Type.equals(Character.TYPE) ) { - equalArrays = Arrays.equals( (char[])f2, - (char[])f1 ); - } else if( f2Type.equals(Byte.TYPE) ) { - equalArrays = Arrays.equals( (byte[])f2, - (byte[])f1 ); - } else if( f2Type.equals(Short.TYPE) ) { - equalArrays = Arrays.equals( (short[])f2, - (short[])f1 ); - } else if( f2Type.equals(Integer.TYPE) ) { - equalArrays = Arrays.equals( (int[])f2, - (int[])f1 ); - } else if( f2Type.equals(Long.TYPE) ) { - equalArrays = Arrays.equals( (long[])f2, - (long[])f1 ); - } else if( f2Type.equals(Float.TYPE) ) { - equalArrays = Arrays.equals( (float[])f2, - (float[])f1 ); - } else if( f2Type.equals(Double.TYPE) ) { - equalArrays = Arrays.equals( (double[])f2, - (double[])f1 ); - }//endif - - //else 1 primitive, 1 not primitive ==> !equalArrays - - }//endif - - if( !equalArrays ) {//f1 not equal f2 - fieldVals.add(f1); - fieldVals.add(f2); - retMap.put(field1, fieldVals); - continue;//next field - }//endif - - continue;//f1 equals f2, skip it and go to next field - - }//endif( f2Class.isArray() && f1Class.isArray() ) - - //(not arrays && !f2.equals(f1)) - fieldVals.add(f1); - fieldVals.add(f2); - retMap.put(field1, fieldVals); - - }//endif( !f2.equals(f1) ) - - }//end loop - - return retMap; - - } catch (IllegalAccessException e) { - // should never happen, all entry fields are public - throw new AssertionError(e); - } - } - - /** - * Convenience method that, given two <code>Entry</code> instances, - * copies the values of the <i>usable</i> (<code>public</code>, - * non-<code>transient</code>, non-<code>static</code>, - * non-<code>final</code>) fields of the first <code>Entry</code> - * parameter to the usable fields of the same name to the second given - * <code>Entry</code> parameter. Any usable field from one of the - * parameters that does not have a counterpart in the other parameter - * will be by passed. This method can be useful, for example, when - * converting an <code>AcinionAttribute</code> to a parallel - * <code>AcinionEvent</code> for reporting outside of the system. - * If <code>null</code> is input for either parameter, then - * <code>null</code> is returned. - */ - public static Entry copyEntry(Entry e1, Entry e2, Logger logger) { - if (e1 == null || e2 == null) return null; - Entry retEntry = e2; - String e1Name = (e1.getClass()).getSimpleName(); - String retEntryName = (retEntry.getClass()).getSimpleName(); - - Field[] e1Fields = EntryUtil.getFieldInfo(e1); - Field[] retEntryFields = EntryUtil.getFieldInfo(retEntry); - if( e1Fields == null || e1Fields.length == 0 ) return null; - if( retEntryFields == null || retEntryFields.length == 0 ) return null; - for(int i=0; i<e1Fields.length; i++) { - Field e1Field = e1Fields[i]; - String e1FieldName = e1Field.getName(); - for(int j=0; j<retEntryFields.length; j++) { - Field retEntryField = retEntryFields[j]; - String retEntryFieldName = retEntryField.getName(); - String errStr = (logger == null ? null : - "cannot set " - +retEntryName+"."+retEntryFieldName - +" to value of " - +e1Name+"."+e1FieldName ); - if( e1FieldName.equals(retEntryFieldName) ) { - try { - retEntryField.set( retEntry, e1Field.get(e1) ); - } catch(IllegalArgumentException e) { - if(logger != null) logger.log(Level.WARN, errStr); - e.printStackTrace(); - } catch(IllegalAccessException e) { - if(logger != null) logger.log(Level.WARN, errStr); - e.printStackTrace(); - } - }//endif - }//end loop(j) - }//end loop(i) - return retEntry; - } - - /** - * Returns an instance of the given <code>Entry</code> class with - * all <i>usable</i> (public, non-static, non-transient, non-final) - * fields set to <code>null</code>. The object returned by this method - * can be used as a template that will match any <code>Entry</code> - * that is of the same type as the <code>Entry</code> input to this - * method. - * - * This method can be useful when working with an <code>Entry</code> - * instance that defines a no-arg constructor that sets one or more - * of its fields to a non-<code>null</code> value. - */ - public static Entry wildcardAll(Entry entry) { - try { - Class realClass = entry.getClass(); - Entry template = (Entry) realClass.newInstance(); - - Field[] f = realClass.getFields(); - for(int i = 0; i < f.length; i++) { - if(! usableField(f[i])) continue; - f[i].set(template, null); - }//end loop - return template; - } catch (Throwable t) { - Logger.getLogger(EntryUtil.class).error("wildcardEntry failed", t); - } - return null; - } - - /** - * Returns a clone of the given {@link Entry}. - * (From com.sun.jini.example.browser.ServiceEditor.) - */ - public static Entry cloneEntry(Entry attr) { - try { - Class realClass = attr.getClass(); - Entry template = (Entry) realClass.newInstance(); - - Field[] f = realClass.getFields(); - for(int i = 0; i < f.length; i++) { - if(! usableField(f[i])) - continue; - f[i].set(template, f[i].get(attr)); - } - - return template; - } catch (Throwable t) { - Logger.getLogger(EntryUtil.class).error("duplicating entry failed", t); - } - return null; - } - - // from EntryRep - private static boolean usableField(Field field) { - Class desc = field.getDeclaringClass(); - - if(desc.isPrimitive()) { - throw new IllegalArgumentException( - "Primitive types not allowed in an Entry: " + field.getName() ); - } - - // skip anything that isn't a public per-object mutable field - int mods = field.getModifiers(); - return (0 == (mods & (Modifier.TRANSIENT | Modifier.STATIC | Modifier.FINAL))); - } +// // from EntryRep +// private static boolean usableField(Field field) { +// Class desc = field.getDeclaringClass(); +// +// if(desc.isPrimitive()) { +// throw new IllegalArgumentException( +// "Primitive types not allowed in an Entry: " + field.getName() ); +// } +// +// // skip anything that isn't a public per-object mutable field +// int mods = field.getModifiers(); +// return (0 == (mods & (Modifier.TRANSIENT | Modifier.STATIC | Modifier.FINAL))); +// } } Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 13:39:12 UTC (rev 3633) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-27 13:44:37 UTC (rev 3634) @@ -75,6 +75,7 @@ suite.addTestSuite( TestCSVReader.class ); suite.addTestSuite( TestBootStateUtil.class ); + suite.addTestSuite( TestEntryUtil.class ); return suite; } Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestEntryUtil.java 2010-09-27 13:44:37 UTC (rev 3634) @@ -0,0 +1,313 @@ +package com.bigdata.util; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import net.jini.core.entry.Entry; +import net.jini.entry.AbstractEntry; +import net.jini.lookup.entry.Address; +import net.jini.lookup.entry.Comment; +import net.jini.lookup.entry.Location; +import net.jini.lookup.entry.Name; +import net.jini.lookup.entry.ServiceType; +import junit.framework.TestCase; + +public class TestEntryUtil extends TestCase { + + public void testGetEntryByType_with_null_args() + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + Object[][] cmdLines = { + {null, null}, + {null, Name.class}, + {new Entry[] {}, null} + }; + for (Object[] args: cmdLines) { + @SuppressWarnings("unchecked") + Object r = EntryUtil.getEntryByType( + (Entry[])args[0], (Class<? extends Entry>)args[1]); + assertNull(r); + } + } + + public void testGetEntryByType_with_emtpy_args() + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + Name t = EntryUtil.getEntryByType(new Entry[]{}, Name.class); + assertNull(t); + } + + public void testGetEntryByType_no_match() + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + Entry[] entries = new Entry[] { + new Address(), + new Comment(), + new Location() + }; + Name t = EntryUtil.getEntryByType(entries, Name.class); + assertNull(t); + } + + public void testGetEntryByType_match() + throws SecurityException, NoSuchMethodException, + IllegalArgumentException, IllegalAccessException, InvocationTargetException + { + Entry[] entries = new Entry[] { + new Address(), + new Comment(), + new Location() + }; + Location t = EntryUtil.getEntryByType(entries, Location.class); + assertNotNull(t); + } + + public void testDisplayEntryEntryLogger() { + EntryUtil.displayEntry( + new Address(), + getLevelLogger(Level.DEBUG)); + } + + public void testDisplayEntryEntryStringLogger() { + EntryUtil.displayEntry( + new Location(), + "Label", + getLevelLogger(Level.DEBUG)); + } + + public void testDisplayEntryStringEntryStringLogger() { + EntryUtil.displayEntry( + "Prefix", + new Comment("This is a comment."), + "Label", + getLevelLogger(Level.DEBUG)); + } + + public void testDisplayEntryStringEntryStringLogger_null() { + EntryUtil.displayEntry( + null, + null, + null, + getLevelLogger(Level.DEBUG)); + } + + private static void assertNotEquivalentEntries(Entry entry1, Entry entry2) { + assertFalse( + EntryUtil.compareEntries( + entry1, + entry2, + getLevelLogger(Level.TRACE))); + } + + public void testCompareEntries_not_equal_null() { + Entry entry1 = null; + Entry entry2 = new Name(); + assertNotEquivalentEntries(entry1, entry2); + assertNotEquivalentEntries(entry2, entry1); + } + + public void testCompareEntries_not_equal_diff_type() { + Entry entry1 = new Name(); + Entry entry2 = new Address(); + assertNotEquivalentEntries(entry1, entry2); + assertNotEquivalentEntries(entry2, entry1); + } + + public void testCompareEntries_not_equal_diff_content() { + Entry entry1 = new Name("Name1"); + Entry entry2 = new Name("Name2"); + assertNotEquivalentEntries(entry1, entry2); + assertNotEquivalentEntries(entry2, entry1); + } + + private static void assertEquivalentEntries(Entry entry1, Entry entry2) { + assertTrue( + EntryUtil.compareEntries( + entry1, + entry2, + getLevelLogger(Level.TRACE))); + } + + public void testCompareEntries_equal_null() { + Entry entry1 = null; + Entry entry2 = null; + assertEquivalentEntries(entry1, entry2); + assertEquivalentEntries(entry2, entry1); + } + + public void testCompareEntries_equal_same_content() { + Entry entry1 = new Name("Name1"); + Entry entry2 = new Name("Name1"); + assertEquivalentEntries(entry1, entry2); + assertEquivalentEntries(entry2, entry1); + } + + public void testCompareEntrySets_equiv_null() { + Entry[] entries1 = null; + Entry[] entries2 = null; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_equiv_empty() { + Entry[] entries1 = new Entry[] {}; + Entry[] entries2 = new Entry[] {}; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_equiv_non_empty_singleton() { + Entry[] entries1 = new Entry[] {new Address()}; + Entry[] entries2 = new Entry[] {new Address()}; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_equiv_non_empty_mulitple() { + Entry[] entries1 = new Entry[] {new Address(), new Name(), new Location()}; + Entry[] entries2 = new Entry[] {new Address(), new Name(), new Location()}; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_equiv_non_empty_mulitple_and_dups() { + Entry[] entries1 = + new Entry[] {new Address(), new Name(), new Location(), + new Location(), new Name()}; + Entry[] entries2 = + new Entry[] {new Address(), new Name(), new Location(), + new Address()}; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + private static void assertEquivalentSets(Entry[] entries1, Entry[] entries2) { + assertTrue( + EntryUtil.compareEntrySets("Equivalent", + entries1, + entries2, + getLevelLogger(Level.TRACE))); + } + + private static void assertNotEquivalentSets(Entry[] entries1, Entry[] entries2) { + assertFalse( + EntryUtil.compareEntrySets("Not equivalent", + entries1, + entries2, + getLevelLogger(Level.TRACE))); + } + + public void testCompareEntrySets_unequiv_null() { + Entry[] entries1 = null; + Entry[] entries2 = new Entry[] {}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_non_empty_singleton() { + Entry[] entries1 = new Entry[] {new Comment("C1")}; + Entry[] entries2 = new Entry[] {new Comment("C2")}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_non_empty_diff_size() { + Entry[] entries1 = new Entry[] {new Comment("C1")}; + Entry[] entries2 = new Entry[] {new Comment("C2"), new Comment("C3")}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public static class MyServiceType extends ServiceType { + private static final long serialVersionUID = 1L; + //Only public, non-transient/final/static are used for Entry objs + public String name = null; + public String desc = null; + + public MyServiceType() {} //default cons per spec + + public MyServiceType(String name, String desc) { + super(); + this.name = name; + this.desc = desc; + } + + @Override + public String getDisplayName() { + return name; + } + + @Override + public String getShortDescription() { + return desc; + } + } + + public void testCompareEntrySets_equiv_serviceType() { + Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; + Entry[] entries2 = new Entry[] {new MyServiceType("A", "B")}; + assertEquivalentSets(entries1, entries2); + assertEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_serviceType() { + Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; + Entry[] entries2 = new Entry[] {new MyServiceType("A", "C")}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_serviceType2() { + Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; + Entry[] entries2 = new Entry[] {new MyServiceType("D", "B")}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_serviceType_null1() { + Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; + Entry[] entries2 = new Entry[] {new MyServiceType(null, "B")}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + public void testCompareEntrySets_unequiv_serviceType_null2() { + Entry[] entries1 = new Entry[] {new MyServiceType("A", "B")}; + Entry[] entries2 = new Entry[] {new MyServiceType("A", null)}; + assertNotEquivalentSets(entries1, entries2); + assertNotEquivalentSets(entries2, entries1); + } + + private static class MyEntryWithUnusableFields extends AbstractEntry { + private static final long serialVersionUID = 1L; // final, static, excluded + public final String finalString = "finalString"; // final, excluded + public transient String transientString = "transientString"; // trans, excluded + public static String staticString = "staticString"; // static, excluded + private String privateString = "privateString"; // private, excluded + public String publicString = "publicString"; // included + } + + public void testGetFieldInfo() { + MyEntryWithUnusableFields mf = new MyEntryWithUnusableFields(); + Field[] fields = EntryUtil.getFieldInfo(mf); + assertTrue(fields.length==1); + assertTrue(fields[0].getName().equals("publicString")); + } + + private static Logger getLevelLogger(Level level) { + Logger logger = getLogger(); + logger.setLevel(level); + return logger; + } + private static Logger getLogger() { + return Logger.getLogger(TestEntryUtil.class); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-27 13:39:18
|
Revision: 3633 http://bigdata.svn.sourceforge.net/bigdata/?rev=3633&view=rev Author: blevine218 Date: 2010-09-27 13:39:12 +0000 (Mon, 27 Sep 2010) Log Message: ----------- delete additional files for tests that were moved to bigdata-integ Removed Paths: ------------- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/config/ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-27 13:34:25
|
Revision: 3632 http://bigdata.svn.sourceforge.net/bigdata/?rev=3632&view=rev Author: blevine218 Date: 2010-09-27 13:34:16 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Delete unit tests that have been moved to bigdata-integ Modified Paths: -------------- branches/maven_scaleout/bigdata-core/src/test/deploy/testing/test.xml branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/TestAll.java Removed Paths: ------------- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoringRemote.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarter.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarterRemote.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/config/TestAll.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/config/TestServiceConfiguration.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/config/TestServiceConfigurationRemote.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/config/TestZookeeperServerEntry.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/service/jini/AbstractServerTestCase.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/service/jini/PerformanceTest.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/service/jini/TestAll.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/service/jini/TestBigdataClient.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/service/jini/TestBigdataClientRemote.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/AbstractZooTestCase.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestAll.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestHierarchicalZNodeWatcher.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestUnknownChildrenWatcher.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZLockImpl.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZNodeCreatedWatcher.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZNodeDeletedWatcher.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZooBarrier.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZooElection.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZooQueue.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/zookeeper/TestZookeeperAccessor.java Modified: branches/maven_scaleout/bigdata-core/src/test/deploy/testing/test.xml =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/deploy/testing/test.xml 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/deploy/testing/test.xml 2010-09-27 13:34:16 UTC (rev 3632) @@ -277,9 +277,6 @@ <test name="com.bigdata.search.TestAll" todir="${test.results.dir}" unless="testName" /> <test name="com.bigdata.relation.TestAll" todir="${test.results.dir}" unless="testName" /> - <!-- See https://sourceforge.net/apps/trac/bigdata/ticket/53 --> - <test name="com.bigdata.jini.TestAll" todir="${test.results.dir}" unless="testName" /> - <test name="com.bigdata.rdf.TestAll" todir="${test.results.dir}" unless="testName" /> <test name="com.bigdata.rdf.sail.TestAll" todir="${test.results.dir}" unless="testName" /> Modified: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/TestAll.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/TestAll.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/TestAll.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -113,8 +113,6 @@ suite.addTest( com.bigdata.relation.TestAll.suite() ); // suite.addTest( com.bigdata.service.mapReduce.TestAll.suite() ); - // Jini integration - suite.addTest(com.bigdata.jini.TestAll.suite()); // RDF suite.addTest(com.bigdata.rdf.TestAll.suite()); Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/TestAll.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,95 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jun 26, 2006 - */ -package com.bigdata.jini; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import com.bigdata.service.jini.AbstractServerTestCase; - -/** - * Aggregates tests in dependency order. The service tests require that Jini is - * running, that you have specified a suitable security policy, etc. See - * {@link AbstractServerTestCase} for <strong>required</strong> system - * properties in order to run this test suite - * - * @version $Id$ - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - */ -public class TestAll extends TestCase { - - public TestAll() { - } - - public TestAll(String name) { - super(name); - } - - public static Test suite() { - - /* - * log4j defaults to DEBUG which will produce simply huge amounts of - * logging information when running the unit tests. Therefore we - * explicitly set the default logging level to WARN. If you are using a - * log4j configuration file then this is unlikely to interact with your - * configuration, and in any case you can override specific loggers. - */ - { - - final Logger log = Logger.getRootLogger(); - - if (log.getLevel().equals(Level.DEBUG)) { - - log.setLevel(Level.WARN); - - log - .warn("Defaulting debugging level to WARN for the unit tests"); - - } - - } - - final TestSuite suite = new TestSuite("jini"); - - // zookeeper client library (queues, locks, etc). - suite.addTest(com.bigdata.zookeeper.TestAll.suite()); - - // concrete impls of bigdata services using jini. - suite.addTest(com.bigdata.service.jini.TestAll.suite()); - - // bigdata services manager test suite. - suite.addTest(com.bigdata.jini.start.TestAll.suite()); - - return suite; - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,234 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 7, 2009 - */ - -package com.bigdata.jini.start; - -import java.io.File; -import java.util.List; -import java.util.UUID; - -import com.bigdata.DataFinder; -import junit.framework.TestCase2; -import net.jini.config.Configuration; -import net.jini.config.ConfigurationProvider; - -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.KeeperException.NodeExistsException; -import org.apache.zookeeper.ZooDefs.Ids; -import org.apache.zookeeper.data.ACL; - -import com.bigdata.jini.start.config.ZookeeperClientConfig; -import com.bigdata.jini.start.process.ProcessHelper; -import com.bigdata.jini.start.process.ZookeeperProcessHelper; -import com.bigdata.resources.ResourceFileFilter; -import com.bigdata.service.jini.JiniClient; -import com.bigdata.service.jini.JiniFederation; - -/** - * Abstract base class for unit tests requiring a running zookeeper and a - * running federation as configured from a test resource. - * <p> - * You MUST specify a security policy, e.g.: - * - * <pre> - * -Djava.security.policy=policy.all - * </pre> - * - * for these tests to run. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class AbstractFedZooTestCase extends TestCase2 { - - /** - * - */ - public AbstractFedZooTestCase() { - } - - /** - * @param arg0 - */ - public AbstractFedZooTestCase(String arg0) { - super(arg0); - } - - /** - * A configuration file used by some of the unit tests in this package. - */ - protected final String configFile = DataFinder.bestURI("testing/data/com/bigdata/jini/start/testfed.config").toASCIIString(); - - // ACL used for the unit tests. - protected final List<ACL> acl = Ids.OPEN_ACL_UNSAFE; - - Configuration config; - - final protected MockListener listener = new MockListener(); - - JiniFederation fed; - - String zrootname = null; - - public void setUp() throws Exception { - - zrootname = getName() + "_" + UUID.randomUUID(); - - if (new File(zrootname).exists()) { - // clean out old files. - recursiveDelete(new File(zrootname)); - } - - // a unique zroot in the /test namespace. - final String zroot = "/"+zrootname;//"/test/" + zrootname; - - System.err.println(getName() + ": setting up zrootname=" + zrootname); - - final String[] args = new String[] { configFile, - // Note: overrides the zroot to be unique. - ZookeeperClientConfig.Options.NAMESPACE + "." - + ZookeeperClientConfig.Options.ZROOT + "=" + "\"" - + zroot + "\"" , -// // Override the federation name. -// "bigdata.fedname=\""+fedname+"\"" - }; - - // apply the federation name to the configuration file. - System.setProperty("bigdata.zrootname", zrootname); - - config = ConfigurationProvider.getInstance(args); - - // if necessary, start zookeeper (a server instance). - ZookeeperProcessHelper.startZookeeper(config, listener); - - /* - * FIXME We need to start a jini lookup service for groups = {fedname} - * for this test to succeed. - */ - - fed = JiniClient.newInstance(args).connect(); - - /* - * Create the federation zroot and config znodes. - */ - final ZooKeeper zookeeper = fed.getZookeeper(); - - // make sure that we have the zroot that we overrode above. - assertEquals(zroot, fed.getZooConfig().zroot); - - fed.createKeyZNodes(zookeeper); - - } - - public void tearDown() throws Exception { - - System.err.println(getName() + ": tearing down zrootname=" + zrootname); - - // destroy any processes started by this test suite. - for (ProcessHelper t : listener.running) { - - t.kill(true/*immediateShutdown*/); - - } - - if (fed != null) { - - /* - * @todo if we do this to kill zk then we must ensure that a private - * instance was started on the desired port. That means an override - * for the configuration file and an unused port assigned for the - * client and peers on the zk instance started for this unit test. - */ -// ZooHelper.kill(clientPort); - - fed.shutdownNow(); - - } - - if (zrootname != null && new File(zrootname).exists()) { - - /* - * Wait a bit and then try and delete the federation directory - * structure. - */ - - try { - Thread.sleep(250); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - - recursiveDelete(new File(zrootname)); - - } - - } - - /** - * Recursively removes any files and subdirectories and then removes the - * file (or directory) itself. - * <p> - * Note: Files that are not recognized will be logged by the - * {@link ResourceFileFilter}. - * - * @param f - * A file or directory. - */ - private void recursiveDelete(final File f) { - - if (f.isDirectory()) { - - final File[] children = f.listFiles(); - - if (children == null) { - - // The directory does not exist. - return; - - } - - for (int i = 0; i < children.length; i++) { - - recursiveDelete(children[i]); - - } - - } - - if(log.isInfoEnabled()) - log.info("Removing: " + f); - - if (f.exists() && !f.delete()) { - - log.warn("Could not remove: " + f); - - } - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/DestroyTransactionService.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,111 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 10, 2009 - */ - -package com.bigdata.jini.start; - -import java.rmi.RemoteException; - -//BTM import com.bigdata.service.IService; -import com.bigdata.service.jini.JiniClient; -import com.bigdata.service.jini.JiniFederation; -import com.bigdata.service.jini.RemoteDestroyAdmin; -import com.bigdata.service.jini.TransactionServer; - -//BTM -import com.bigdata.journal.TransactionService; -import com.sun.jini.admin.DestroyAdmin; -import net.jini.admin.Administrable; - -/** - * Destroys a specific service - the {@link TransactionServer}. This is for use - * in testing the behavior of the {@link ServicesManagerServer} and the behavior - * of the other services in the federation when the {@link TransactionServer} is - * lost. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class DestroyTransactionService { - - /** - * @param args - * Configuration file and optional overrides. - * - * @throws InterruptedException - * @throws RemoteException - */ - public static void main(String[] args) throws InterruptedException, - RemoteException { - - JiniFederation fed = JiniClient.newInstance(args).connect(); - - try { - -//BTM IService service = fed.getTransactionService(); -TransactionService service = fed.getTransactionService(); - - if (service == null) { - - System.err.println("Service not found."); - - } else { -if(service instanceof RemoteDestroyAdmin) { - ((RemoteDestroyAdmin) service).destroy(); - System.err.println("destroyed transaction service [remote implementation]"); -} else if(service instanceof Administrable) { - try { - Object serviceAdmin = ((Administrable)service).getAdmin(); - if(serviceAdmin instanceof DestroyAdmin) { - try { - ((DestroyAdmin)serviceAdmin).destroy(); - System.err.println("destroyed transaction service [smart proxy implementation]"); - } catch(Throwable t) { - System.err.println("ERROR: exception while destroying transaction service ["+t+"]"); - } - } else { - System.err.println("FAILURE: transaction service admin not instance of DestroyAdmin"); - } - } catch(Throwable t) { - System.err.println("ERROR: exception from call to getAdmin while destroying transaction service ["+t+"]"); - } -} else { - System.err.println("FAILURE: transaction service not instance of Administrable"); -} - -//BTM System.err.println("Service destroyed."); - - } - - } finally { - - fed.shutdown(); - - } - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/MockListener.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,44 +0,0 @@ -package com.bigdata.jini.start; - -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.apache.log4j.Logger; - -import com.bigdata.jini.start.process.ProcessHelper; - -/** - * Mock implementation used by some unit tests. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class MockListener implements IServiceListener { - - protected static final Logger log = Logger.getLogger(MockListener.class); - - protected static final boolean INFO = log.isInfoEnabled(); - - protected static final boolean DEBUG = log.isDebugEnabled(); - - public Queue<ProcessHelper> running = new ConcurrentLinkedQueue<ProcessHelper>(); - - public void add(ProcessHelper service) { - - if (INFO) - log.info("adding: " + service); - - running.add(service); - - } - - public void remove(ProcessHelper service) { - - if (INFO) - log.info("removing: " + service); - - running.remove(service); - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestAll.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,72 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jun 26, 2006 - */ -package com.bigdata.jini.start; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import com.bigdata.jini.start.config.TestZookeeperServerEntry; -import com.bigdata.service.jini.AbstractServerTestCase; - -/** - * Aggregates tests in dependency order - see {@link AbstractServerTestCase} for - * <strong>required</strong> system properties in order to run this test suite. - * - * @version $Id$ - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - */ -public class TestAll extends TestCase { - - public TestAll() { - } - - public TestAll(String name) { - super(name); - } - - public static Test suite() { - - final TestSuite suite = new TestSuite("start"); - - // - suite.addTestSuite(TestServiceConfigurationZNodeEnum.class); - - // test suite for parsing zookeeper server entries. - suite.addTestSuite(TestZookeeperServerEntry.class); - - // test suite for starting a bigdata service from a service config. - suite.addTestSuite(TestServiceStarter.class); - - // test suite for managing a logical service using a watcher. - suite.addTestSuite(TestServiceConfigurationMonitoring.class); - - return suite; - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,247 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 11, 2009 - */ - -package com.bigdata.jini.start; - -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import com.bigdata.DataFinder; -import junit.framework.TestCase2; -import net.jini.admin.Administrable; -import net.jini.config.Configuration; -import net.jini.config.ConfigurationProvider; -import net.jini.core.lookup.ServiceItem; -import net.jini.core.lookup.ServiceRegistrar; -import net.jini.core.lookup.ServiceTemplate; -import net.jini.discovery.LookupDiscoveryManager; -import net.jini.lookup.ServiceDiscoveryManager; - -import com.bigdata.jini.start.config.JiniCoreServicesConfiguration; -import com.bigdata.jini.start.config.JiniCoreServicesConfiguration.Options; -import com.bigdata.jini.start.process.JiniCoreServicesProcessHelper; -import com.bigdata.jini.util.ConfigMath; -import com.bigdata.service.jini.JiniClientConfig; -import com.bigdata.service.jini.util.JiniServicesHelper; - -/** - * Test suite for the {@link JiniCoreServicesProcessHelper} - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestJiniCoreServicesProcessHelper extends TestCase2 { - - /** - * - */ - public TestJiniCoreServicesProcessHelper() { - - } - - /** - * @param arg0 - */ - public TestJiniCoreServicesProcessHelper(String arg0) { - super(arg0); - - } - - /** - * The configuration file used the unit tests. - */ - protected final String configFile = DataFinder.bestURI("testing/data/com/bigdata/jini/start/testjini.config").toASCIIString(); - - /** - * The configuration read from that file with any overrides applied. - */ - protected Configuration config; - - protected final MockListener listener = new MockListener(); - - /** - * Reads the {@link #config} from the {@link #configFile}. - * <p> - * Note: You can specify JINI_HOME in your environment in order to override - * the location where jini is installed on your machine. - */ - protected void setUp() throws Exception { - - final String[] args; - { - - final String home = System.getenv("JINI_HOME"); - - if (home == null) { - - args = new String[] { configFile }; - - } else { - - /* - * Overrides the serviceDir to your jini install location. - */ - - args = new String[] { - configFile, - JiniCoreServicesConfiguration.Options.NAMESPACE + "." - + Options.SERVICE_DIR + "=" - + ConfigMath.q(home) }; - - } - - } - - // read the configuration, applying the override if set above. - config = ConfigurationProvider.getInstance(args); - -// logLevel = jiniLog.getLevel(); -// -// jiniLog.addHandler(new Handler(){ -// -// @Override -// public void close() throws SecurityException { -// // TODO Auto-generated method stub -// -// } -// -// @Override -// public void flush() { -// // TODO Auto-generated method stub -// -// } -// -// @Override -// public void publish(LogRecord record) { -// System.err.println("jini: "+record); -// }}); -// -// System.err.println("logLevel="+logLevel); -// -// // turn on lots of logging. -// jiniLog.setLevel( -// java.util.logging.Level.ALL); - - } - -// final static Logger jiniLog = Logger.getLogger("net.jini.discovery.LookupDiscovery"); -// -// private java.util.logging.Level logLevel; -// -// public void tearDown() throws Exception { -// -// // restore the log level. -// jiniLog.setLevel(logLevel); -// -// } - - /** - * @todo this is not really a unit test yet - more of a tool to helper debug - * the behavior when starting and (trying to) kill the jini core - * services. - * <p> - * The main problem with testability is that I have not figured out - * how to kill jini programmatically. One consequence is that this - * "test" will not terminate if it starts a jini instance until you - * close the jini instance in the gui. - * - * @see JiniCoreServicesProcessHelper#startCoreServices(Configuration, - * IServiceListener) - */ - public void test_findStartKill() throws Exception { - - final JiniCoreServicesConfiguration serviceConfig = new JiniCoreServicesConfiguration( - config); - - final JiniClientConfig clientConfig = new JiniClientConfig( - null/* class */, config); - - // make sure jini is not running before we start this test. - assertFalse("Jini already running: locators=" - + Arrays.toString(clientConfig.locators), JiniServicesHelper - .isJiniRunning(clientConfig.groups, clientConfig.locators, 500, - TimeUnit.MILLISECONDS)); - - boolean serviceStarted = - JiniCoreServicesProcessHelper.startCoreServices(config, listener); - String testName = (this.getClass()).getSimpleName(); - if(serviceStarted) { - // Find and shutdown lookup service started above - ServiceDiscoveryManager sdm = - new ServiceDiscoveryManager - (new LookupDiscoveryManager(clientConfig.groups, - clientConfig.locators, null), - null); - Class[] types = new Class[] { ServiceRegistrar.class }; - ServiceTemplate tmpl = new ServiceTemplate(null, types, null); - ServiceItem regItem = sdm.lookup(tmpl, null, 5L*1000L); - if(regItem == null) { - System.err.println - ("WARNING ["+testName+"]: lookup service started but " - +"could not discover it for shutdown"); - } else { - ServiceRegistrar reg = (ServiceRegistrar)(regItem.service); - List<String> groupsList = Arrays.asList(reg.getGroups()); - System.err.println - ("INFO ["+testName+"]: lookup service started " - +"[groups="+groupsList+"] - shutting it down"); - Object admin = ((Administrable)reg).getAdmin(); - ((com.sun.jini.admin.DestroyAdmin)admin).destroy(); - System.err.println - ("INFO ["+testName+"]: lookup service started and " - +"destroyed - [groups="+groupsList+"]"); - } - } - - // Shutdown the httpd class server - String httpdStopCmd = - (String)config.getEntry("jini", "httpdStopCmd", String.class, - null /*force exception if not in config*/); - System.err.println - ("INFO ["+testName+"]: shutdown class server ["+httpdStopCmd+"]"); - Runtime.getRuntime().exec(httpdStopCmd); - - assertTrue(serviceStarted); - -// -// final JiniCoreServicesStarter<JiniCoreServicesProcessHelper> serviceStarter = serviceConfig -// .newServiceStarter(listener); -// -// // start jini. -// final JiniCoreServicesProcessHelper processHelper = serviceStarter.call(); -// -// // make sure jini is running. -// assertTrue(JiniServicesHelper.isJiniRunning(clientConfig.groups, -// clientConfig.locators, 500, TimeUnit.MILLISECONDS)); -// -// // destroy jini. -// processHelper.kill(); - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,203 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 7, 2009 - */ - -package com.bigdata.jini.start; - -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeoutException; - -import net.jini.config.ConfigurationException; - -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.KeeperException; -import org.apache.zookeeper.ZooKeeper; - -import com.bigdata.io.SerializerUtil; -import com.bigdata.jini.start.config.ServiceConfiguration; -import com.bigdata.jini.start.config.TransactionServerConfiguration; -import com.bigdata.service.jini.TransactionServer; - -/** - * Test suite for monitoring state changes for a {@link ServiceConfiguration} - * and creating a new physical service instance. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestServiceConfigurationMonitoring extends AbstractFedZooTestCase { - - protected boolean serviceImplRemote; - - /** - * - */ - public TestServiceConfigurationMonitoring() { - this.serviceImplRemote = false; - } - - /** - * @param arg0 - */ - public TestServiceConfigurationMonitoring(String arg0) { - super(arg0); - this.serviceImplRemote = false; - } - - public TestServiceConfigurationMonitoring - (boolean serviceImplRemote) - { - this.serviceImplRemote = serviceImplRemote; - } - - public TestServiceConfigurationMonitoring - (String arg0, boolean serviceImplRemote) - { - super(arg0); - this.serviceImplRemote = serviceImplRemote; - } - - /** - * @throws InterruptedException - * @throws KeeperException - * @throws ConfigurationException - * @throws ExecutionException - * @throws TimeoutException - * - * @todo Unit test where the appropriate watchers are established and we - * then create the service configuration znode and let the watchers - * handle the creation of the logical and physical services and their - * znodes. - * - * @todo verify that normal service shutdown does remove the ephemeral znode - * and that service restart re-creates the SAME ephemeral znode (both - * should be true as the znode is created using the assigned service - * UUID rather than SEQUENTIAL so that it can be a restart safe - * zpath). - */ - public void test_logicalServiceWatcher() throws KeeperException, - InterruptedException, ConfigurationException, ExecutionException, - TimeoutException { - - // the config for that fake zroot. - final String zconfig = fed.getZooConfig().zroot + BigdataZooDefs.ZSLASH - + BigdataZooDefs.CONFIG; - - final ZooKeeper zookeeper = fed.getZookeeper(); - - final int numBefore = listener.running.size(); - - // zpath for the service configuration znode. - final String serviceConfigurationZPath = zconfig - + BigdataZooDefs.ZSLASH - + TransactionServer.class.getName(); - - // create monitor task that will compete for locks and start procsses. - MonitorCreatePhysicalServiceLocksTask task1 = new MonitorCreatePhysicalServiceLocksTask( - fed, listener); - - final Future f1 = fed.getExecutorService().submit(task1); - - assertFalse(f1.isDone()); - - // create monitor task for a specific service config node. - ServiceConfigurationZNodeMonitorTask task = new ServiceConfigurationZNodeMonitorTask( - fed, listener, TransactionServer.class.getName()); - - final Future f = fed.getExecutorService().submit(task); - - assertFalse(f.isDone()); - - /* - * Create znode for the ServiceConfiguration. - * - * Note: This should trigger the watcher. In turn, then watcher should - * create an instance of the service on our behalf. - */ - log.info("Creating zpath [serviceImplRemote="+serviceImplRemote+"]: " - +serviceConfigurationZPath); - - if(serviceImplRemote) { - zookeeper.create(serviceConfigurationZPath, SerializerUtil - .serialize(new TransactionServerConfiguration(TransactionServer.class, config)), acl, - CreateMode.PERSISTENT); - } else { - zookeeper.create(serviceConfigurationZPath, SerializerUtil - .serialize(new TransactionServerConfiguration(com.bigdata.transaction.ServiceImpl.class, config)), acl, - CreateMode.PERSISTENT); - } - - log.info("Created zpath: " + serviceConfigurationZPath); - - /* - * Verify that a logicalService znode was created for that configuration - * znode. - */ - - // pause a moment. - Thread.sleep(1000/*ms*/); - - log.info("logicalServices: " - + zookeeper.getChildren(serviceConfigurationZPath, false)); - - assertEquals(1, zookeeper.getChildren(serviceConfigurationZPath, false) - .size()); - - /* - * Let things run for few seconds. - * - * This give the task the chance to notice the ServiceConfiguration - * znode (we just created it) and to execute the task that creates the - * new logical service. - */ - - Thread.sleep(10000/*ms*/); - - if (f.isDone()) { - f.get(); - fail("not expecting task to end by itself."); - } else - f.cancel(true/* mayInterruptIfRunning */); - - if (f1.isDone()) { - f1.get(); - fail("not expecting task to end by itself."); - } else - f1.cancel(true/* mayInterruptIfRunning */); - - /* - * FIXME verify service is created, discover and query that service and - * verify that it is the instance that we wanted, then shutdown service - * and then verify service restart re-creates the same ephemeral node. - */ - - // verify a process was started. - assertEquals(numBefore + 1, listener.running.size()); - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoringRemote.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoringRemote.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoringRemote.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,42 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package com.bigdata.jini.start; - -/** - * Test suite for monitoring state changes for a {@link ServiceConfiguration} - * and creating a new physical service instance using the purely remote - * service implementation. - */ -public class TestServiceConfigurationMonitoringRemote - extends TestServiceConfigurationMonitoring -{ - public TestServiceConfigurationMonitoringRemote() { - super(true); - } - - public TestServiceConfigurationMonitoringRemote(String arg0) { - super(arg0, true); - } -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,131 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 12, 2009 - */ - -package com.bigdata.jini.start; - -import com.bigdata.service.jini.TransactionServer; - -import junit.framework.TestCase2; - -/** - * Test suite for {@link ServiceConfigurationZNodeEnum}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestServiceConfigurationZNodeEnum extends TestCase2 { - - /** - * - */ - public TestServiceConfigurationZNodeEnum() { - - } - - /** - * @param arg0 - */ - public TestServiceConfigurationZNodeEnum(String arg0) { - - super(arg0); - - } - - final String serviceConfigZPath = "test-fed/" + BigdataZooDefs.CONFIG + "/" - + TransactionServer.class.getName(); - - /** - * <p> - * The behavior can be best interpreted with reference to an example: - * - * <pre> - * test-fed - * locks - * serviceConfigMonitor - * com.bigdata.service.jini.TransactionServer - * lock0000000000 (Ephemeral) - * createPhysicalService - * config - * W com.bigdata.service.jini.TransactionServer {TransactionServiceConfiguration} - * W logicalService0000000000 - * W physicalServices - * W abde9b91-24d5-4dc5-9bbf-41d7e7cac272 (Ephemeral) - * masterElection - * lock0000000000 (Ephemeral) - * </pre> - * - * In this example, the <code>W</code> appears at the start of each - * watched znode for the {@link TransactionServerConfiguration} znode. The - * master election znode can be seen directly below that. - */ - public void test01() { - - assertEquals(ServiceConfigurationZNodeEnum.ServiceConfiguration, - ServiceConfigurationZNodeEnum - .getType(serviceConfigZPath, serviceConfigZPath)); - - assertEquals(ServiceConfigurationZNodeEnum.LogicalService, - ServiceConfigurationZNodeEnum.getType(serviceConfigZPath, - serviceConfigZPath + "/" - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX - + "0000000000")); - - assertEquals(ServiceConfigurationZNodeEnum.PhysicalServicesContainer, - ServiceConfigurationZNodeEnum.getType(serviceConfigZPath, - serviceConfigZPath + "/" - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX - + "0000000000"+"/" - + BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER)); - - - assertEquals(ServiceConfigurationZNodeEnum.PhysicalService, - ServiceConfigurationZNodeEnum.getType(serviceConfigZPath, - serviceConfigZPath + "/" - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX - + "0000000000" + "/" - + BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER - + "/" + "abde9b91-24d5-4dc5-9bbf-41d7e7cac272")); - - assertEquals(ServiceConfigurationZNodeEnum.MasterElection, - ServiceConfigurationZNodeEnum.getType(serviceConfigZPath, - serviceConfigZPath + "/" - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX - + "0000000000" + "/" - + BigdataZooDefs.MASTER_ELECTION - )); - - assertEquals(ServiceConfigurationZNodeEnum.MasterElectionLock, - ServiceConfigurationZNodeEnum.getType(serviceConfigZPath, - serviceConfigZPath + "/" - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX - + "0000000000" + "/" - + BigdataZooDefs.MASTER_ELECTION - + "/" + "lock0000000000")); - - } - -} Deleted: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarter.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarter.java 2010-09-25 17:41:54 UTC (rev 3631) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/jini/start/TestServiceStarter.java 2010-09-27 13:34:16 UTC (rev 3632) @@ -1,316 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Jan 5, 2009 - */ - -package com.bigdata.jini.start; - -import java.io.IOException; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -import net.jini.config.ConfigurationException; -import net.jini.core.lookup.ServiceID; -import net.jini.core.lookup.ServiceItem; -import net.jini.core.lookup.ServiceTemplate; -import net.jini.lease.LeaseRenewalManager; -import net.jini.lookup.ServiceDiscoveryManager; - -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.data.Stat; - -import com.bigdata.io.SerializerUtil; -import com.bigdata.jini.start.config.BigdataServiceConfiguration; -import com.bigdata.jini.start.config.ServiceConfiguration; -import com.bigdata.jini.start.config.TransactionServerConfiguration; -import com.bigdata.jini.start.config.ManagedServiceConfiguration.ManagedServiceStarter; -import com.bigdata.jini.start.process.ProcessHelper; -import com.bigdata.jini.util.JiniUtil; -import com.bigdata.service.IService; -import com.bigdata.service.Service; -import com.bigdata.service.jini.RemoteDestroyAdmin; -import com.bigdata.service.jini.TransactionServer; -import com.bigdata.zookeeper.ZNodeDeletedWatcher; -import com.bigdata.zookeeper.ZooHelper; - -/** - * Test suite for starting a bigdata service based on a - * {@link ServiceConfiguration} stored in {@link ZooKeeper}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestServiceStarter extends AbstractFedZooTestCase { - - protected boolean serviceImplRemote; - - /** - * - */ - public TestServiceStarter() { - this.serviceImplRemote = false; - - } - - /** - * @param arg0 - */ - public TestServiceStarter(String arg0) { - - super(arg0); - this.serviceImplRemote = false; - - } - - public TestServiceStarter(boolean serviceImplRemote) { - this.serviceImplRemote = serviceImplRemote; - } - - public TestServiceStarter(String arg0, boolean serviceImplRemote) { - super(arg0); - this.serviceImplRemote = serviceImplRemote; - } - - /** - * Unit test verifies that we can start and destroy a service instance using - * a {@link BigdataServiceConfiguration}. The test waits until the service - * has been assigned its serviceId by jini and verify that the serviceId is - * recorded in the physicalService znode. - * - * @throws ConfigurationException - * @throws Exception - */ - public void test_startServer() throws ConfigurationException, Exception { - -// // create a unique fake zroot -// final String zroot = createTestZRoot(); -// -// // the config for that fake zroot. -// final String zconfig = zroot + BigdataZooDefs.ZSLASH -// + BigdataZooDefs.CONFIG; - - final ZooKeeper zookeeper = fed.getZookeeper(); - - TransactionServerConfiguration serviceConfig = null; - if(serviceImplRemote) { - serviceConfig = new TransactionServerConfiguration - (TransactionServer.class, config); - } else { - serviceConfig = - new TransactionServerConfiguration - (com.bigdata.transaction.ServiceImpl.class, config); - } - - // znode for serviceConfiguration - final String zserviceConfig = zookeeper.create(fed.getZooConfig().zroot - + BigdataZooDefs.ZSLASH + BigdataZooDefs.CONFIG - + BigdataZooDefs.ZSLASH - + TransactionServer.class.getName(), SerializerUtil - .serialize(serviceConfig), acl, CreateMode.PERSISTENT); - - /* - * znode for a logical service (the logical service is either a - * collection of peers or a service failover chain, depending on the - * type of the service). Logical services are persistent. Each one is - * assigned a unique (sequential) identifier by zookeeper. It is also - * assigned a random UUID. - */ - final String logicalServiceZPath = zookeeper.create(zserviceConfig - + BigdataZooDefs.LOGICAL_SERVICE_PREFIX, SerializerUtil.serialize(UUID - .randomUUID()), acl, CreateMode.PERSISTENT_SEQUENTIAL); - - /* - * Create the znode that is the parent for the physical service - * instances (direct child of the logicalSevice znode). - */ - final String parentZNode = logicalServiceZPath + "/" + BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER; - final ManagedServiceStarter serviceStarter = - (ManagedServiceStarter) serviceConfig.newServiceStarter - (fed, listener, logicalServiceZPath, null/* attributes */); - zookeeper.create(parentZNode, - SerializerUtil.serialize(serviceStarter.serviceUUID), - acl, CreateMode.PERSISTENT); - - /* - * Create the znode for the election of the primary physical service for - * this logical service (direct child of the logicalSevice znode). - */ - zookeeper.create(logicalServiceZPath + "/" - + BigdataZooDefs.MASTER_ELECTION, new byte[0], acl, - CreateMode.PERSISTENT); - - // will be zero unless we started a zookeeper server above. - final int processCountBefore = listener.running.size(); - - // start the service. - final ProcessHelper processHelper = serviceStarter.call(); - - // verify listener was notified of service start. - assertEquals(processCountBefore + 1, listener.running.size()); - - // verify that the physicalService was registered with zookeeper. - final ServiceItem serviceItem; - IService proxy = null; - Service smartProxy = null; - final String physicalServiceZPath; - { - - final List<String> children = zookeeper.getChildren( - logicalServiceZPath, false/* watch */); - - System.err.println("physicalServices=" + children); - - // will fail if the znode was not registered. - assertEquals(2, children.size()); - - /* - * There should be only one child, which is the physical service - * that we created. - * - * Note: You could explicitly build the correct zpath using the - * serviceUUID obtained from the service proxy. - */ - physicalServiceZPath = logicalServiceZPath + "/" - + children.get(0); - - // get the serviceUUID from the physicalServiceZNode's data. - final UUID serviceUUID = (UUID) SerializerUtil - .deserialize(zookeeper.getData(physicalServiceZPath, - false/* watch */, new Stat())); - - serviceItem = discoverService(serviceUUID); - - // verify that the service item is registered with jini. - assertNotNull(serviceItem); - - // save reference to the service proxy. - if(serviceItem.service instanceof IService) { - proxy = (IService)serviceItem.service; - } else if(serviceItem.service instanceof Service) { - smartProxy = (Service)serviceItem.service; - } else { - fail("service not an instance of either Service or IService"); - } - } - - // Verify the service UUID using the proxy - if(proxy == null) { - assertEquals(JiniUtil.serviceID2UUID(serviceItem.serviceID), smartProxy.getServiceUUID()); - } else { - assertEquals(JiniUtil.serviceID2UUID(serviceItem.serviceID), proxy.getServiceUUID()); - } - - // Verify the service name using the proxy - // (Note: only do this for the remote case, - // names will be different for smart proxy case) - if(proxy != null) { - assertEquals(serviceStarter.serviceName, proxy.getServiceName()); - } - - // Tell the service to destroy itself. - if(proxy == null) { - try { - ((com.sun.jini.admin.DestroyAdmin)(((net.jini.admin.Administrable)smartProxy).getAdmin())).destroy(); - } catch(Throwable t) { - System.out.println("TestServiceStarter: SHUTDOWN WARNING ["+t+"]"); - t.printStackTrace(); - } - } else { - ((RemoteDestroyAdmin)proxy).destroy(); - } -// listener.running.get(0).destroy(); - - // wait a bit for the process to die. - processHelper.exitValue(10L, TimeUnit.SECONDS); - - // verify that it has been removed from our listener. - assertEquals("Expected " + processCountBefore + ", but #running=" - + listener.running.size() + ", processes=" - + listener.running.toString(), processCountBefore, - listener.running.size()); - - ZooHelper.destroyZNodes(zookeeper, parentZNode, 1); - - /* - * Wait until the znode for the physical service has been removed. - * - * Note: An ephemeral znode will be removed once the zookeeper client - * either times out or is explicitly closed. Since we are killing the - * process rather than terminating the service normally we may have to - * raise the timeout before zookeeper will delete the service's znode on - * its behalf. - */ - if (!ZNodeDeletedWatcher.awaitDelete(zookeeper, physicalServiceZPath, - 20000, TimeUnit.MILLISECONDS)) { - - fail("znode not removed: zpath=" + physicalServiceZPath); - - } - - } - - /** - * Looks up the service item in any joined jini registrars but does not wait - * for the service item to become registered. - * - * @param serviceUUID - * - * @return - * - * @throws IOException - */ - protected ServiceItem discoverService(final UUID serviceUUID) throws IOException { - - final ServiceID serviceId = JiniUtil.uuid2ServiceID(serviceUUID); - - ServiceDiscoveryManager serviceDiscoveryManager = null; - try { - - serviceDiscoveryManager = new ServiceDiscoveryManager(fed - .getDiscoveryManagement(), new LeaseRenewalManager()); - - final ServiceItem item = serviceDiscoveryManager - .lookup(new ServiceTemplate(serviceId, null/* iface[] */, - null/* entry[] */),// - null // filter - ); - - return item; - - } finally { - - if (serviceDiscoveryManager != null) { - - serviceDiscoveryManager.terminate(); - - } - - } - -... [truncated message content] |
From: <tho...@us...> - 2010-09-25 17:42:00
|
Revision: 3631 http://bigdata.svn.sourceforge.net/bigdata/?rev=3631&view=rev Author: thompsonbry Date: 2010-09-25 17:41:54 +0000 (Sat, 25 Sep 2010) Log Message: ----------- Added worksheet for query cost models. Updates notes on the quads query branch. Modified the remote access path test to run using READ_COMMITTED views. Removed a worksheet with old performance data. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestRemoteAccessPath.java Added Paths: ----------- branches/QUADS_QUERY_BRANCH/bigdata/src/architecture/query-cost-model.xls Removed Paths: ------------- branches/QUADS_QUERY_BRANCH/bigdata/src/architecture/performance.xls Deleted: branches/QUADS_QUERY_BRANCH/bigdata/src/architecture/performance.xls =================================================================== (Binary files differ) Added: branches/QUADS_QUERY_BRANCH/bigdata/src/architecture/query-cost-model.xls =================================================================== (Binary files differ) Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/architecture/query-cost-model.xls ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt 2010-09-25 00:31:32 UTC (rev 3630) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt 2010-09-25 17:41:54 UTC (rev 3631) @@ -123,7 +123,7 @@ For standalone the decision should be based on whether more leaves would be read (the tuple range count may be used as a proxy for this) by issuing individual subqueries for the - specific as bound predicates or by leaving with C unbound. + specific as bound predicates or by reading with C unbound. For scale-out, the decision is different since we can use multi-block iterators on the index segments and do fewer @@ -158,105 +158,79 @@ SPARQL default graph query patterns. Note: Default graph queries require us to apply a distinct {s,p,o} -filter to each default graph access path. +filter to each default graph access path. The default graph queries +uses an expander pattern. See DefaultGraphSolutionExpander and its +inner classes. -Standalone: +The following special cases exist: - The default graph queries uses an expander pattern. See - DefaultGraphSolutionExpander and its inner classes. - - The following special cases exist: - - The default graph data set is empty (no graphs were identified which are known to the database), in which case an empty access path is used. - The default graph data set includes a single graph which is known to the database. C is bound and we impose a filter which strips - off the context position. See StripContextAccessPath. + off the context position. Because C takes on only one value, a + distinct filter is not required. This means that scale-out can + use normal pipeline joins. - - The default graph data set includes all graphs. C is left unbound - and we impose a distinct SPO filter which strips off the context - position. See MergeAllGraphsAccessPath. + See StripContextAccessPath. - - The default graph data set includes more than a threshold number - of graphs. C is left unbound and we impose a distinct SPO filter - which strips off the context position. See - MergeAllGraphsAccessPath. + - ___C index: We know that C is strictly ascending in index order + within each triple. Use an advancer pattern or ignore quads until + the data changes to a new triple. Apply a filter to strip off the + context position. - FIXME The threshold for this case is 200, which is WAY too - low. - - For standalone the decision should be based on whether more - leaves would be read (the tuple range count may be used as a - proxy for this) by issuing individual subqueries for the - specific as bound predicates or by leaving with C unbound. + The same optimization works in scale-out using shard-wise pipeline + joins if the ___C index was created with the constraint that the + all quads for a given triple are on the same shard. - For scale-out, the decision is different since we can use - multi-block iterators on the index segments and do fewer - disk seeks. + - SCALEOUT and VERY HIGH VOLUME: Use a distributed external merge + sort to impose distinct and do operator at a time processing. - - The default graph data set includes more than one graph but less - than some threshold #of graphs. Parallel subtasks are evaluated - for each graph in the data set and write on a shared - BlockingBuffer. The BlockingBuffer is wrapped with an - SPORelation.distinctSPOIterator(). See - DefaultGraphParallelEvaluationAccessPath. + - SCAN and FILTER: The default graph data set includes all graphs OR + the cost of scanning with C unbound is less than the cost of + subqueries with C bound (for scale-out, subquery cost must be + estimated for a remote access path). C is left unbound and we + impose a distinct SPO filter which strips off the context + position. Unless all graphs are being merged, we also apply an IN + filter. - Note: This works out better for standalone because the queries are - much more selective, even when there are a large number of graphs - in the default graph data set. + SCALEOUT: The join evaluation context is ANY, uses a remote access + path, and the access path should be configured to move a + lot of data efficiently over the remote range iterator. -Scale-out: + - It is possible to partition the IN filter based on the + shard on which it will be applied (split the ordered + list of contexts based on the contexts found in a + given shard). - Special cases exist for: - - - The SPOC index when s, p, and o are bound and we have a guarantee - that an SPO prefix is never split (standalone or when the - appropriate ISimpleSplitHandler is defined for the SPOC index). - In this case we can use the normal pipelined join and apply an - optimized distinct filter because we know that C is strictly - ascending. + See MergeAllGraphsAccessPath. - - High volume access paths: Based on a cost analysis, leave C - unbound and then applies an IN filter. This works better because - we can handle the reads on the SPOC index with C unbound very - efficiently in scale-out by using a multi-block iterator on the - index segments. [However, we must still impose DISTINCT on the - access path.] + - SUBQUERY: Parallel subtasks are evaluated for each graph in the + data set and write on a shared BlockingBuffer. The BlockingBuffer + is wrapped with an SPORelation.distinctSPOIterator(). - - For very high volume operations we could do distributed merge - sorts to impose distinct and do operator at a time processing. + SCALEOUT: Mark the join evaluation context as ANY and mark the + access path as remote. -- @todo Add annotation to Predicate to indicate the use of an RMI - access path in scale-out. Modify PipelineJoin such that it can be - used as an ANY operator -or- a SHARDED operator. For default graph - queries, we need to make the join ANY and the predicate use RMI. + Tune the capacity for the remote access path iterator. + When the remote access path will be selective, the + capacity should be small and we will pay a high price if + there are a lot of nested subqueries. When the remote + access path is less selective the capacity should be + larger to reduce the #of RMI requests made per access + path. -- @todo Create a cost plan for leaving C unbound and then filtering - for standalone and scale-out. These will have different cost - profiles. Normalize the range count to the expected number of - leaves. For standalone, the expected number of seeks is predicted by - the standard log linear model and the expected #of transfers is one - per seek. For scale-out, the expected #of seeks is two (per shard) - and the expected #of transfers is one per 1M of leaves. For - scale-out, we must also factor in the RMI cost for doing RMI based - subqueries. This has been pretty substantial in the past, but that - might also have to do with unisolated vs read committed vs read-only - tx views. + Note: The way the code is written, the access path will + do RMI for the range count before issuing the RMI + iterator request. Look at ways to optimize this. -- @todo The current named and default graph solution expanders use a - threshold for filtering which is WAY too low. Raise this into the - query rewrite based on the cost plan, per above. + See DefaultGraphParallelEvaluationAccessPath. - @todo Lazily create the hash map for the distinctSPOIterator when we observe the 2nd distinct SPO value. -- @todo An optimized distinct filter for SPOC. We can note the last - observed {s,p,o} and skip to the next possible o in the index - (o:=o+1) using an advancer pattern (this could also just scan until - o changes). - --- UNION(ops)[maxParallel(default all)] Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestRemoteAccessPath.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestRemoteAccessPath.java 2010-09-25 00:31:32 UTC (rev 3630) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestRemoteAccessPath.java 2010-09-25 17:41:54 UTC (rev 3631) @@ -67,7 +67,7 @@ * @version $Id$ * * @todo test read-committed access paths. - * @todo test read historical access paths. + * @todo test read historical access paths (read-only tx). * @todo test unisolated (writable) access paths. * @todo test fully isolated access paths. */ @@ -97,12 +97,11 @@ /** The query controller. */ private FederatedQueryEngine queryEngine; - + /** - * The read only transaction identifier used for the test (initially set to - * an invalid value). + * The timestamp or transaction identifier used for the test. */ - private long tx = Long.MAX_VALUE; + private long tx = ITx.READ_COMMITTED; public Properties getProperties() { @@ -179,8 +178,11 @@ loadData(); - // read-only transaction from the most recent commit point on the db. - tx = fed.getTransactionService().newTx(ITx.READ_COMMITTED); + /* + * Optionally obtain a read-only transaction from the some commit point + * on the db. + */ +// tx = fed.getTransactionService().newTx(ITx.READ_COMMITTED); } @@ -198,8 +200,10 @@ queryEngine = null; } - if (tx != Long.MAX_VALUE) + if (tx != ITx.READ_COMMITTED && tx != ITx.UNISOLATED) { + // Some kind of transaction. fed.getTransactionService().abort(tx); + } super.tearDown(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-25 00:31:41
|
Revision: 3630 http://bigdata.svn.sourceforge.net/bigdata/?rev=3630&view=rev Author: thompsonbry Date: 2010-09-25 00:31:32 +0000 (Sat, 25 Sep 2010) Log Message: ----------- Added support for RMI access paths. All operators now assume "ANY" as their evaluation context. This means that you must explicitly override the evaluation context for scale-out JOINS in order to use shard-partitioned access paths versus remote access paths. The default of "ANY" is not valid for some operators. Such operators now check in their shallow copy constructor to verify that a legal evaluation context was explicitly set. At this point we have the tools to evaluate a default graph query in scale-out. The Rule2BOpUtility needs to be modified to become aware of standalone versus scale-out and to use the appropriate operator patterns for standalone and scale-out. The correct operator pattern depends on a number of factors. I will be working up a cost model and pulling the logic out of DefaultGraphSolutionExpander and NamedGraphSolutionExpander. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpBase.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpEvaluationContext.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ChunkedOrderedIteratorOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IPredicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/PipelineOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Predicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/bset/StartOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/JoinGraph.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/mutation/InsertOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ndx/AbstractSampleIndex.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/solutions/MemorySortOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/solutions/SliceOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/solutions/SortOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/AbstractRelation.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/ap/TestPredicateAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/engine/TestPipelineUtility.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/engine/TestQueryEngine.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/engine/TestQueryEngine_Slice.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/engine/TestRunState.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestFederatedQueryEngine.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/solutions/TestMemorySortOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/solutions/TestSliceOp.java branches/QUADS_QUERY_BRANCH/bigdata-jini/src/test/com/bigdata/bop/fed/jini/TestJiniFederatedQueryEngine.java Added Paths: ----------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BufferAnnotations.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestRemoteAccessPath.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -90,13 +90,13 @@ } - protected int getFullyBufferedReadThreshold() { +// protected int getFullyBufferedReadThreshold() { +// +// return getProperty(Annotations.FULLY_BUFFERED_READ_THRESHOLD, +// Annotations.DEFAULT_FULLY_BUFFERED_READ_THRESHOLD); +// +// } - return getProperty(Annotations.FULLY_BUFFERED_READ_THRESHOLD, - Annotations.DEFAULT_FULLY_BUFFERED_READ_THRESHOLD); - - } - protected long getChunkTimeout() { return getProperty(Annotations.CHUNK_TIMEOUT, Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -161,10 +161,8 @@ int getId(); /** - * Return the evaluation context for the operator. The default is - * {@link BOpEvaluationContext#ANY}. Operators which must be mapped against - * shards, mapped against nodes, or evaluated on the query controller must - * override this method. + * Return the evaluation context for the operator as specified by + * {@link Annotations#EVALUATION_CONTEXT}. */ BOpEvaluationContext getEvaluationContext(); @@ -245,6 +243,14 @@ String TIMESTAMP = BOp.class.getName() + ".timestamp"; /** + * This annotation determines where an operator will be evaluated + * (default {@value #DEFAULT_EVALUATION_CONTEXT}). + */ + String EVALUATION_CONTEXT = BOp.class.getName() + ".evaluationContext"; + + BOpEvaluationContext DEFAULT_EVALUATION_CONTEXT = BOpEvaluationContext.ANY; + + /** * For hash partitioned operators, this is the set of the member nodes * for the operator. * <p> Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpBase.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpBase.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpBase.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -362,16 +362,11 @@ } - /** - * The default implementation returns {@link BOpEvaluationContext#ANY} and - * must be overridden by operators which have a different {@link BOpEvaluationContext}. - * <p> - * {@inheritDoc} - */ - public BOpEvaluationContext getEvaluationContext() { - - return BOpEvaluationContext.ANY; - + final public BOpEvaluationContext getEvaluationContext() { + + return getProperty(Annotations.EVALUATION_CONTEXT, + Annotations.DEFAULT_EVALUATION_CONTEXT); + } public final boolean isMutation() { Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -38,6 +38,7 @@ import com.bigdata.btree.IRangeQuery; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.TimestampUtility; +import com.bigdata.relation.AbstractRelation; import com.bigdata.relation.IRelation; import com.bigdata.relation.accesspath.AccessPath; import com.bigdata.relation.accesspath.IAccessPath; @@ -50,7 +51,7 @@ import com.bigdata.striterator.IKeyOrder; /** - * The evaluation context for the operator (NOT serializable). + * Base class for the bigdata operation evaluation context (NOT serializable). * * @param <E> * The generic type of the objects processed by the operator. @@ -147,12 +148,13 @@ * order to support mutation operator we will also have to pass in the * {@link #writeTimestamp} or differentiate this in the method name. */ - public IRelation getRelation(final IPredicate<?> pred) { + @SuppressWarnings("unchecked") + public <E> IRelation<E> getRelation(final IPredicate<E> pred) { /* * Note: This uses the federation as the index manager when locating a - * resource for scale-out. However, s/o reads must use the local index - * manager when actually obtaining the index view for the relation. + * resource for scale-out since that let's us look up the relation in + * the global row store, which is being used as a catalog. */ final IIndexManager tmp = getFederation() == null ? getIndexManager() : getFederation(); @@ -160,7 +162,7 @@ final long timestamp = (Long) pred .getRequiredProperty(BOp.Annotations.TIMESTAMP); - return (IRelation<?>) tmp.getResourceLocator().locate( + return (IRelation<E>) tmp.getResourceLocator().locate( pred.getOnlyRelationName(), timestamp); } @@ -194,11 +196,25 @@ * Obtain an access path reading from relation for the specified predicate * (from the tail of some rule). * <p> - * Note that passing in the {@link IRelation} is important since it - * otherwise must be discovered using the {@link IResourceLocator}. By - * requiring the caller to resolve it before hand and pass it into this - * method the contention and demand on the {@link IResourceLocator} cache is - * reduced. + * Note: Passing in the {@link IRelation} is important since it otherwise + * must be discovered using the {@link IResourceLocator}. By requiring the + * caller to resolve it before hand and pass it into this method the + * contention and demand on the {@link IResourceLocator} cache is reduced. + * <p> + * <h2>Scale-Out</h2> + * <p> + * Note: You MUST be extremely careful when using expanders with a local + * access path for a shared-partitioned or hash-partitioned index. Only + * expanders whose semantics remain valid with a partial view of the index + * will behave as expected. Here are some examples that DO NOT work: + * <ul> + * <li>"DISTINCT" on a partitioned local access path is not coherent</li> + * <li>Expanders which generate reads against keys not found on that shard + * are not coherent.</li> + * </ul> + * If you have requirements such as these, then either use a remote access + * path or change your query plan design more radically to take advantage of + * efficient shard-wise scans in scale-out. * * @param relation * The relation. @@ -211,19 +227,39 @@ * * @todo replaces * {@link IJoinNexus#getTailAccessPath(IRelation, IPredicate)}. + * + * @todo Reconcile with IRelation#getAccessPath(IPredicate) once the bop + * conversion is done. It has much of the same logic (this also + * handles remote access paths now). + * + * @todo Support mutable relation views. */ - @SuppressWarnings("unchecked") - public IAccessPath<?> getAccessPath(final IRelation<?> relation, - final IPredicate<?> predicate) { +// @SuppressWarnings("unchecked") + public <E> IAccessPath<E> getAccessPath(final IRelation<E> relation, + final IPredicate<E> predicate) { if (relation == null) throw new IllegalArgumentException(); if (predicate == null) throw new IllegalArgumentException(); - // FIXME This should be as assigned by the query planner so the query is fully declarative. - final IKeyOrder keyOrder = relation.getKeyOrder((IPredicate) predicate); + /* + * FIXME This should be as assigned by the query planner so the query is + * fully declarative. + */ + final IKeyOrder<E> keyOrder; + { + final IKeyOrder<E> tmp = predicate.getKeyOrder(); + if (tmp != null) { + // use the specified index. + keyOrder = tmp; + } else { + // ask the relation for the best index. + keyOrder = relation.getKeyOrder(predicate); + } + } + if (keyOrder == null) throw new RuntimeException("No access path: " + predicate); @@ -233,26 +269,24 @@ .getRequiredProperty(BOp.Annotations.TIMESTAMP); final int flags = predicate.getProperty( - PipelineOp.Annotations.FLAGS, - PipelineOp.Annotations.DEFAULT_FLAGS) + IPredicate.Annotations.FLAGS, + IPredicate.Annotations.DEFAULT_FLAGS) | (TimestampUtility.isReadOnly(timestamp) ? IRangeQuery.READONLY : 0); final int chunkOfChunksCapacity = predicate.getProperty( - PipelineOp.Annotations.CHUNK_OF_CHUNKS_CAPACITY, - PipelineOp.Annotations.DEFAULT_CHUNK_OF_CHUNKS_CAPACITY); + BufferAnnotations.CHUNK_OF_CHUNKS_CAPACITY, + BufferAnnotations.DEFAULT_CHUNK_OF_CHUNKS_CAPACITY); final int chunkCapacity = predicate.getProperty( - PipelineOp.Annotations.CHUNK_CAPACITY, - PipelineOp.Annotations.DEFAULT_CHUNK_CAPACITY); + BufferAnnotations.CHUNK_CAPACITY, + BufferAnnotations.DEFAULT_CHUNK_CAPACITY); final int fullyBufferedReadThreshold = predicate.getProperty( - PipelineOp.Annotations.FULLY_BUFFERED_READ_THRESHOLD, - PipelineOp.Annotations.DEFAULT_FULLY_BUFFERED_READ_THRESHOLD); + IPredicate.Annotations.FULLY_BUFFERED_READ_THRESHOLD, + IPredicate.Annotations.DEFAULT_FULLY_BUFFERED_READ_THRESHOLD); - final IIndexManager indexManager = getIndexManager(); - - if (predicate.getPartitionId() != -1) { + if (partitionId != -1) { /* * Note: This handles a read against a local index partition. For @@ -269,12 +303,14 @@ // return ((AbstractRelation<?>) relation) // .getAccessPathForIndexPartition(indexManager, // (IPredicate) predicate); + /* - * @todo This condition should probably be an error since the expander - * will be ignored. + * @todo This is an error since expanders are currently ignored on + * shard-wise access paths. While it is possible to enable expanders + * for shard-wise access paths. */ -// if (predicate.getSolutionExpander() != null) -// throw new IllegalArgumentException(); + if (predicate.getSolutionExpander() != null) + throw new IllegalArgumentException(); final String namespace = relation.getNamespace();//predicate.getOnlyRelationName(); @@ -286,60 +322,70 @@ final ILocalBTreeView ndx = (ILocalBTreeView) indexManager .getIndex(name, timestamp); - return new AccessPath(relation, indexManager, timestamp, + return new AccessPath<E>(relation, indexManager, timestamp, predicate, keyOrder, ndx, flags, chunkOfChunksCapacity, chunkCapacity, fullyBufferedReadThreshold).init(); } - /* - * Find the best access path for the predicate for that relation. - * - * @todo Replace this with IRelation#getAccessPath(IPredicate) once the - * bop conversion is done. It is the same logic. - */ - IAccessPath accessPath; - { - // accessPath = relation.getAccessPath((IPredicate) predicate); - final IIndex ndx = relation.getIndex(keyOrder); + // Decide on a local or remote view of the index. + final IIndexManager indexManager; + if (predicate.isRemoteAccessPath()) { + // use federation in scale-out for a remote access path. + indexManager = fed != null ? fed : this.indexManager; + } else { + indexManager = this.indexManager; + } - if (ndx == null) { - - throw new IllegalArgumentException("no index? relation=" - + relation.getNamespace() + ", timestamp=" - + timestamp + ", keyOrder=" + keyOrder + ", pred=" - + predicate + ", indexManager=" + getIndexManager()); + // Obtain the index. + final String fqn = AbstractRelation.getFQN(relation, keyOrder); + final IIndex ndx = AbstractRelation.getIndex(indexManager, fqn, timestamp); - } + if (ndx == null) { - accessPath = new AccessPath((IRelation) relation, indexManager, - timestamp, (IPredicate) predicate, - (IKeyOrder) keyOrder, ndx, flags, chunkOfChunksCapacity, - chunkCapacity, fullyBufferedReadThreshold).init(); + throw new IllegalArgumentException("no index? relation=" + + relation.getNamespace() + ", timestamp=" + timestamp + + ", keyOrder=" + keyOrder + ", pred=" + predicate + + ", indexManager=" + getIndexManager()); } - - /* - * @todo No expander's for bops, at least not right now. They could be - * added in easily enough, which would support additional features for - * standalone query evaluation (runtime materialization of some - * entailments). - * - * FIXME temporarily enabled expanders (mikep) - */ - final ISolutionExpander<?> expander = predicate.getSolutionExpander(); - - if (expander != null) { - - // allow the predicate to wrap the access path - accessPath = expander.getAccessPath(accessPath); - - } - // return that access path. + // Obtain the access path for that relation and index. + final IAccessPath<E> accessPath = new AccessPath<E>( + relation, indexManager, timestamp, + predicate, keyOrder, ndx, flags, + chunkOfChunksCapacity, chunkCapacity, + fullyBufferedReadThreshold).init(); + + // optionally wrap with an expander pattern. + return expander(predicate, accessPath); + + } + + /** + * Optionally wrap with an expander pattern. + * + * @param predicate + * @param accessPath + * @return + * @param <E> + */ + private <E> IAccessPath<E> expander(final IPredicate<E> predicate, + final IAccessPath<E> accessPath) { + + final ISolutionExpander<E> expander = predicate.getSolutionExpander(); + + if (expander != null) { + + // allow the predicate to wrap the access path + return expander.getAccessPath(accessPath); + + } + return accessPath; + } } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpEvaluationContext.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpEvaluationContext.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpEvaluationContext.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -22,7 +22,11 @@ * The operator may be evaluated anywhere, including piecewise evaluation on * any node of the cluster where its inputs are available. This is used for * operators which do not need to concentrate or coordinate their inputs - * such as {@link ConditionalRoutingOp}. + * such as {@link ConditionalRoutingOp}. It may also be used in combination + * with a remote access path to impose a DISTINCT filter across one or more + * shards or nodes. + * + * @see IPredicate.Annotations#REMOTE_ACCESS_PATH */ ANY, /** Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BufferAnnotations.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BufferAnnotations.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BufferAnnotations.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -0,0 +1,84 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Sep 24, 2010 + */ + +package com.bigdata.bop; + +import com.bigdata.relation.accesspath.BlockingBuffer; +import com.bigdata.relation.accesspath.IBuffer; + +/** + * Annotations for {@link BlockingBuffer} as used by various kinds of operators. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public interface BufferAnnotations { + + /** + * The maximum #of chunks that can be buffered before an the producer would + * block (default {@value #DEFAULT_CHUNK_OF_CHUNKS_CAPACITY}). Note that + * partial chunks may be combined into full chunks whose nominal capacity is + * specified by {@link #CHUNK_CAPACITY}. + */ + String CHUNK_OF_CHUNKS_CAPACITY = BlockingBuffer.class.getName() + + ".chunkOfChunksCapacity"; + + /** + * Default for {@link #CHUNK_OF_CHUNKS_CAPACITY} + */ + int DEFAULT_CHUNK_OF_CHUNKS_CAPACITY = 100; + + /** + * Sets the capacity of the {@link IBuffer}s used to accumulate a chunk of + * {@link IBindingSet}s (default {@value #CHUNK_CAPACITY}). Partial chunks + * may be automatically combined into full chunks. + * + * @see #CHUNK_OF_CHUNKS_CAPACITY + */ + String CHUNK_CAPACITY = IBuffer.class.getName() + ".chunkCapacity"; + + /** + * Default for {@link #CHUNK_CAPACITY} + */ + int DEFAULT_CHUNK_CAPACITY = 100; + + /** + * The timeout in milliseconds that the {@link BlockingBuffer} will wait for + * another chunk to combine with the current chunk before returning the + * current chunk (default {@value #DEFAULT_CHUNK_TIMEOUT}). This may be ZERO + * (0) to disable the chunk combiner. + */ + String CHUNK_TIMEOUT = BlockingBuffer.class.getName() + ".chunkTimeout"; + + /** + * The default for {@link #CHUNK_TIMEOUT}. + * + * @todo this is probably much larger than we want. Try 10ms. + */ + int DEFAULT_CHUNK_TIMEOUT = 20; + +} Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BufferAnnotations.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ChunkedOrderedIteratorOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ChunkedOrderedIteratorOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ChunkedOrderedIteratorOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -1,17 +1,7 @@ package com.bigdata.bop; -import com.bigdata.btree.ILocalBTreeView; -import com.bigdata.journal.IIndexManager; -import com.bigdata.rawstore.Bytes; -import com.bigdata.relation.accesspath.AccessPath; -import com.bigdata.relation.accesspath.BlockingBuffer; import com.bigdata.relation.accesspath.IAccessPath; -import com.bigdata.relation.accesspath.IBuffer; -import com.bigdata.relation.rule.eval.IJoinNexus; -import com.bigdata.service.IBigdataFederation; -import com.bigdata.service.IDataService; import com.bigdata.striterator.IChunkedOrderedIterator; -import com.bigdata.striterator.ICloseableIterator; /** * Interface for evaluating operations producing chunks of elements (tuples @@ -25,96 +15,11 @@ public interface ChunkedOrderedIteratorOp<E> extends BOp { /** - * Well known annotations pertaining to the binding set pipeline. + * Well known annotations. */ - public interface Annotations extends BOp.Annotations { + public interface Annotations extends BOp.Annotations, BufferAnnotations { - /** - * The maximum #of chunks that can be buffered before an the producer - * would block (default {@value #DEFAULT_CHUNK_OF_CHUNKS_CAPACITY}). - * Note that partial chunks may be combined into full chunks whose - * nominal capacity is specified by {@link #CHUNK_CAPACITY}. - */ - String CHUNK_OF_CHUNKS_CAPACITY = BlockingBuffer.class.getName() - + ".chunkOfChunksCapacity"; - /** - * Default for {@link #CHUNK_OF_CHUNKS_CAPACITY} - */ - int DEFAULT_CHUNK_OF_CHUNKS_CAPACITY = 1000; - - /** - * Sets the capacity of the {@link IBuffer}s used to accumulate a chunk - * of {@link IBindingSet}s (default {@value #CHUNK_CAPACITY}). Partial - * chunks may be automatically combined into full chunks. - * - * @see #CHUNK_OF_CHUNKS_CAPACITY - */ - String CHUNK_CAPACITY = IBuffer.class.getName() + ".chunkCapacity"; - - /** - * Default for {@link #CHUNK_CAPACITY} - */ - int DEFAULT_CHUNK_CAPACITY = 100; - - /** - * The timeout in milliseconds that the {@link BlockingBuffer} will wait - * for another chunk to combine with the current chunk before returning - * the current chunk (default {@value #DEFAULT_CHUNK_TIMEOUT}). This may - * be ZERO (0) to disable the chunk combiner. - */ - String CHUNK_TIMEOUT = BlockingBuffer.class.getName() + ".chunkTimeout"; - - /** - * The default for {@link #CHUNK_TIMEOUT}. - * - * @todo this is probably much larger than we want. Try 10ms. - */ - int DEFAULT_CHUNK_TIMEOUT = 1000; - - /** - * If the estimated rangeCount for an - * {@link AccessPath#iterator()} is LTE this threshold then use - * a fully buffered (synchronous) iterator. Otherwise use an - * asynchronous iterator whose capacity is governed by - * {@link #CHUNK_OF_CHUNKS_CAPACITY}. - */ - String FULLY_BUFFERED_READ_THRESHOLD = AccessPath.class - .getName() - + ".fullyBufferedReadThreadshold"; - - /** - * Default for {@link #FULLY_BUFFERED_READ_THRESHOLD} - */ - int DEFAULT_FULLY_BUFFERED_READ_THRESHOLD = 20*Bytes.kilobyte32; - } - /** - * Execute the operator, returning an iterator from which the element may be - * read. Operator evaluation may be halted using - * {@link ICloseableIterator#close()}. - * - * @param fed - * The {@link IBigdataFederation} IFF the operator is being - * evaluated on an {@link IBigdataFederation}. When evaluating - * operations against an {@link IBigdataFederation}, this - * reference provides access to the scale-out view of the indices - * and to other bigdata services. - * @param joinNexus - * An evaluation context with hooks for the <em>local</em> - * execution environment. When evaluating operators against an - * {@link IBigdataFederation} the {@link IJoinNexus} MUST be - * formulated with the {@link IIndexManager} of the local - * {@link IDataService} order perform efficient reads against the - * shards views as {@link ILocalBTreeView}s. It is an error if - * the {@link IJoinNexus#getIndexManager()} returns the - * {@link IBigdataFederation} since each read would use RMI. This - * condition should be checked by the operator implementation. - * - * @return An iterator from which the elements may be read. - */ - IChunkedOrderedIterator<E> eval(IBigdataFederation<?> fed, - IJoinNexus joinNexus); - } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IPredicate.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IPredicate.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IPredicate.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -30,6 +30,7 @@ import java.io.Serializable; +import com.bigdata.btree.IRangeQuery; import com.bigdata.mdi.PartitionLocator; import com.bigdata.relation.IMutableRelation; import com.bigdata.relation.IRelation; @@ -61,7 +62,7 @@ /** * Interface declaring well known annotations. */ - public interface Annotations extends BOp.Annotations { + public interface Annotations extends BOp.Annotations, BufferAnnotations { /** * The name of the relation on which the predicate will read. @@ -104,6 +105,85 @@ * not address a specific shard. */ String PARTITION_ID = "partitionId"; + + int DEFAULT_PARTITION_ID = -1; + + /** + * Boolean option determines whether the predicate will use a local + * access path or a remote access path (default + * {@value #DEFAULT_REMOTE_ACCESS_PATH}). + * <p> + * <em>Local access paths</em> are much more efficient and should be + * used for most purposes. However, it is not possible to impose certain + * kinds of filters on a sharded or hash partitioned operations across + * local access paths. In particular, a DISTINCT filter can not be + * imposed using sharded or hash partitioned. + * <p> + * When the access path is local, the parent operator must be annotated + * to use a {@link BOpEvaluationContext#SHARDED shard wise} or + * {@link BOpEvaluationContext#HASHED node-wise} mapping of the binding + * sets. + * <p> + * <em>Remote access paths</em> use a scale-out index view. This view + * makes the scale-out index appear as if it were monolithic rather than + * sharded or hash partitioned. The monolithic view of a scale-out index + * can be used to impose a DISTINCT filter since all tuples will flow + * back to the caller. + * <p> + * When the access path is remote, the parent operator should use + * {@link BOpEvaluationContext#ANY} to prevent the binding sets from + * being moved around when the access path is remote. + * + * @see BOpEvaluationContext + */ + String REMOTE_ACCESS_PATH = "remoteAccessPath"; + + boolean DEFAULT_REMOTE_ACCESS_PATH = false; + + /** + * If the estimated rangeCount for an {@link AccessPath#iterator()} is + * LTE this threshold then use a fully buffered (synchronous) iterator. + * Otherwise use an asynchronous iterator whose capacity is governed by + * {@link #CHUNK_OF_CHUNKS_CAPACITY}. + * + * @see #DEFAULT_FULLY_BUFFERED_READ_THRESHOLD + */ + String FULLY_BUFFERED_READ_THRESHOLD = PipelineOp.class.getName() + + ".fullyBufferedReadThreshold"; + + /** + * Default for {@link #FULLY_BUFFERED_READ_THRESHOLD}. + * + * @todo Experiment with this. It should probably be something close to + * the branching factor, e.g., 100. + */ + int DEFAULT_FULLY_BUFFERED_READ_THRESHOLD = 100; + + /** + * Flags for the iterator ({@link IRangeQuery#KEYS}, + * {@link IRangeQuery#VALS}, {@link IRangeQuery#PARALLEL}). + * <p> + * Note: The {@link IRangeQuery#PARALLEL} flag here is an indication + * that the iterator may run in parallel across the index partitions. + * This only effects scale-out and only for simple triple patterns since + * the pipeline join does something different (it runs inside the index + * partition using the local index, not the client's view of a + * distributed index). + * + * @see #DEFAULT_FLAGS + */ + String FLAGS = PipelineOp.class.getName() + ".flags"; + + /** + * The default flags will visit the keys and values of the non-deleted + * tuples and allows parallelism in the iterator (when supported). + * + * @todo consider making parallelism something that the query planner + * must specify explicitly. + */ + final int DEFAULT_FLAGS = IRangeQuery.KEYS | IRangeQuery.VALS + | IRangeQuery.PARALLEL; + } /** @@ -275,6 +355,13 @@ public int getVariableCount(IKeyOrder<E> keyOrder); /** + * Return <code>true</code> if this is a remote access path. + * + * @see Annotations#REMOTE_ACCESS_PATH + */ + public boolean isRemoteAccessPath(); + + /** * Return the variable or constant at the specified index. * * @param index Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/PipelineOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/PipelineOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/PipelineOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -30,16 +30,10 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import org.apache.log4j.Level; -import org.apache.log4j.Priority; - import com.bigdata.bop.engine.BOpStats; import com.bigdata.bop.engine.QueryEngine; -import com.bigdata.btree.IRangeQuery; -import com.bigdata.relation.accesspath.AccessPath; import com.bigdata.relation.accesspath.BlockingBuffer; import com.bigdata.relation.accesspath.IBlockingBuffer; -import com.bigdata.relation.accesspath.IBuffer; /** * An pipeline operator reads from a source and writes on a sink. This is an @@ -62,103 +56,8 @@ /** * Well known annotations pertaining to the binding set pipeline. */ - public interface Annotations extends BOp.Annotations { + public interface Annotations extends BOp.Annotations, BufferAnnotations { - /** - * The maximum #of chunks that can be buffered before an the producer - * would block (default {@value #DEFAULT_CHUNK_OF_CHUNKS_CAPACITY}). - * Note that partial chunks may be combined into full chunks whose - * nominal capacity is specified by {@link #CHUNK_CAPACITY}. - * - * @see #DEFAULT_CHUNK_OF_CHUNKS_CAPACITY - */ - String CHUNK_OF_CHUNKS_CAPACITY = PipelineOp.class.getName() - + ".chunkOfChunksCapacity"; - - /** - * Default for {@link #CHUNK_OF_CHUNKS_CAPACITY} - * - * @todo was 100. dialed down to reduce heap consumption for arrays. - * test performance @ 100 and 1000. - */ - int DEFAULT_CHUNK_OF_CHUNKS_CAPACITY = 100; - - /** - * Sets the capacity of the {@link IBuffer}s used to accumulate a chunk - * of {@link IBindingSet}s (default {@value #CHUNK_CAPACITY}). Partial - * chunks may be automatically combined into full chunks. - * - * @see #DEFAULT_CHUNK_CAPACITY - * @see #CHUNK_OF_CHUNKS_CAPACITY - */ - String CHUNK_CAPACITY = PipelineOp.class.getName() + ".chunkCapacity"; - - /** - * Default for {@link #CHUNK_CAPACITY} - */ - int DEFAULT_CHUNK_CAPACITY = 100; - - /** - * The timeout in milliseconds that the {@link BlockingBuffer} will wait - * for another chunk to combine with the current chunk before returning - * the current chunk (default {@value #DEFAULT_CHUNK_TIMEOUT}). This may - * be ZERO (0) to disable the chunk combiner. - * - * @see #DEFAULT_CHUNK_TIMEOUT - */ - String CHUNK_TIMEOUT = PipelineOp.class.getName() + ".chunkTimeout"; - - /** - * The default for {@link #CHUNK_TIMEOUT}. - * - * @todo Experiment with values for this. Low values will push chunks - * through quickly. High values will cause chunks to be combined - * and move larger chunks around. [But if we factor BlockingBuffer - * out of the query engine then this will go away]. - */ - int DEFAULT_CHUNK_TIMEOUT = 20; - - /** - * If the estimated rangeCount for an {@link AccessPath#iterator()} is - * LTE this threshold then use a fully buffered (synchronous) iterator. - * Otherwise use an asynchronous iterator whose capacity is governed by - * {@link #CHUNK_OF_CHUNKS_CAPACITY}. - * - * @see #DEFAULT_FULLY_BUFFERED_READ_THRESHOLD - */ - String FULLY_BUFFERED_READ_THRESHOLD = PipelineOp.class.getName() - + ".fullyBufferedReadThreshold"; - - /** - * Default for {@link #FULLY_BUFFERED_READ_THRESHOLD}. - * - * @todo Experiment with this. It should probably be something close to - * the branching factor, e.g., 100. - */ - int DEFAULT_FULLY_BUFFERED_READ_THRESHOLD = 100; - - /** - * Flags for the iterator ({@link IRangeQuery#KEYS}, - * {@link IRangeQuery#VALS}, {@link IRangeQuery#PARALLEL}). - * <p> - * Note: The {@link IRangeQuery#PARALLEL} flag here is an indication - * that the iterator may run in parallel across the index partitions. - * This only effects scale-out and only for simple triple patterns since - * the pipeline join does something different (it runs inside the index - * partition using the local index, not the client's view of a - * distributed index). - * - * @see #DEFAULT_FLAGS - */ - String FLAGS = PipelineOp.class.getName() + ".flags"; - - /** - * The default flags will visit the keys and values of the non-deleted - * tuples and allows parallelism in the iterator (when supported). - */ - final int DEFAULT_FLAGS = IRangeQuery.KEYS | IRangeQuery.VALS - | IRangeQuery.PARALLEL; - } /** Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Predicate.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Predicate.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Predicate.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -42,14 +42,9 @@ import com.bigdata.bop.IVariable; import com.bigdata.bop.IVariableOrConstant; import com.bigdata.bop.NV; -import com.bigdata.btree.IRangeQuery; import com.bigdata.journal.ITx; -import com.bigdata.relation.IRelation; import com.bigdata.relation.accesspath.IElementFilter; import com.bigdata.relation.rule.ISolutionExpander; -import com.bigdata.relation.rule.eval.IJoinNexus; -import com.bigdata.service.IBigdataFederation; -import com.bigdata.striterator.IChunkedOrderedIterator; import com.bigdata.striterator.IKeyOrder; /** @@ -183,8 +178,9 @@ public int getPartitionId() { - return (Integer)annotations.get(Annotations.PARTITION_ID); - + return (Integer) getProperty(Annotations.PARTITION_ID, + Annotations.DEFAULT_PARTITION_ID); + } @SuppressWarnings("unchecked") @@ -256,6 +252,11 @@ } return nunbound; } + + final public boolean isRemoteAccessPath() { + return getProperty(Annotations.REMOTE_ACCESS_PATH, + Annotations.DEFAULT_REMOTE_ACCESS_PATH); + } public Predicate<E> asBound(final IBindingSet bindingSet) { @@ -493,27 +494,4 @@ */ private int hash = 0; - /** - * @todo This does not allow us to override the iterator behavior based on - * the annotations. It also provides expander logic for scaleup and - * handles reading on a shard. It ignores the {@link IKeyOrder} - * associated with the {@link IPredicate} and there is no way to - * specify the {@link IRangeQuery} flags. - */ - @SuppressWarnings("unchecked") - public IChunkedOrderedIterator<E> eval(final IBigdataFederation<?> fed, - final IJoinNexus joinNexus) { - - // Resolve the relation name to the IRelation object. - final IRelation<E> relation = (IRelation<E>) joinNexus - .getTailRelationView(this/* predicate */); - - if (relation == null) - throw new RuntimeException("Not found: " + getOnlyRelationName()); - - return joinNexus.getTailAccessPath(relation, this/* predicate */) - .iterator(); - - } - } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/bset/StartOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/bset/StartOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/bset/StartOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -3,7 +3,6 @@ import java.util.Map; import com.bigdata.bop.BOp; -import com.bigdata.bop.BOpEvaluationContext; /** * A version of {@link CopyBindingSetOp} which is always evaluated on the query @@ -21,11 +20,18 @@ } public StartOp(BOp[] args, Map<String, Object> annotations) { - super(args, annotations); + + super(args, annotations); + + switch (getEvaluationContext()) { + case CONTROLLER: + break; + default: + throw new UnsupportedOperationException( + Annotations.EVALUATION_CONTEXT + "=" + + getEvaluationContext()); + } + } - final public BOpEvaluationContext getEvaluationContext() { - return BOpEvaluationContext.CONTROLLER; - } - } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/Rule2BOpUtility.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -38,6 +38,7 @@ import org.apache.log4j.Logger; import com.bigdata.bop.BOp; import com.bigdata.bop.BOpContextBase; +import com.bigdata.bop.BOpEvaluationContext; import com.bigdata.bop.BOpUtility; import com.bigdata.bop.BindingSetPipelineOp; import com.bigdata.bop.IConstraint; @@ -48,6 +49,7 @@ import com.bigdata.bop.ap.Predicate; import com.bigdata.bop.bset.StartOp; import com.bigdata.bop.join.PipelineJoin; +import com.bigdata.bop.solutions.SliceOp; import com.bigdata.rdf.sail.BigdataSail; import com.bigdata.relation.rule.IProgram; import com.bigdata.relation.rule.IRule; @@ -108,6 +110,8 @@ final BindingSetPipelineOp startOp = new StartOp(new BOp[] {}, NV.asMap(new NV[] {// new NV(Predicate.Annotations.BOP_ID, bopId++),// + new NV(SliceOp.Annotations.EVALUATION_CONTEXT, + BOpEvaluationContext.CONTROLLER),// })); /* @@ -210,6 +214,9 @@ constraints.size() > 0 ? constraints.toArray(new IConstraint[constraints.size()]) : null),// new NV(PipelineJoin.Annotations.OPTIONAL, pred.isOptional()),// + // Note: shard-partitioned joins! + new NV( Predicate.Annotations.EVALUATION_CONTEXT, + BOpEvaluationContext.SHARDED),// })); left = joinOp; Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/engine/notes.txt 2010-09-25 00:31:32 UTC (rev 3630) @@ -1,15 +1,37 @@ RunningQuery: -- FIXME Raise this into an annotation that we can tweak from the unit - tests and then debug the problem. [Write unit tests at the - RunState level.] - -- FIXME Add an annotation or method to mark operators which must be - evaluated using operator-at-a-time evaluation. SORT is the - main example here (it must be operator at a time of necessity) - but other operators may implemented with operator at a time - assumptions. Add a unit tests for sort on the query engine. + - TestJiniFederatedQueryEngine. + - Join=ANY, Predicate=RMI. + + - Unit tests of the default and named graph access path patterns. + + - Cost model for the default graph and named graph access path + patterns so we can choose the right one for each query. + + - Subqueries {Union,Steps,Star}. Implement subquery support. (We + can't test Star until we have the mutation API in place.) + + - PipelineType {Vectored,OneShot}. + + A vectored operator processes its inputs in chunks, producing + output chunks each time it runs. + + An one shot operator runs exactly once for a given query and + must wait for all of its inputs to become available before it + can begin. For example, SORT is a one shot operator. + + - Mutation {Insert, Delete}. Concurrency control. Scale-out + mutation operators must go through the ConcurrencyManager in order + to respect the isolation levels imposed within AbstractTask. For + standalone, we can using either UnisolatedReadWriteIndex or the + ConcurrencyManager as appropriate (but how can we tell which is + appropriate!?!). + + - Mutation {Create, Destroy}. This gets into resource management, + so defer for the moment but tackle in the context of RDFS closure + using STAR. + - MemoryType {Chunked,Blocked}. Blocked operators need to inherit some interface which @@ -56,16 +78,6 @@ */ Blocked, - - - PipelineType {Vectored,OneShot}. - - A vectored operator processes its inputs in chunks, producing - output chunks each time it runs. - - An one shot operator runs exactly once for a given query and - must wait for all of its inputs to become available before it - can begin. For example, SORT is a one shot operator. - Note: Many of the maxParallel annotations related to thread consumption will go away with Java7 and async file IO. Other annotations, such as the #of 1M buffers to allocate to an operator, @@ -210,8 +222,12 @@ unbound and then applies an IN filter. This works better because we can handle the reads on the SPOC index with C unbound very efficiently in scale-out by using a multi-block iterator on the - index segments. + index segments. [However, we must still impose DISTINCT on the + access path.] + - For very high volume operations we could do distributed merge + sorts to impose distinct and do operator at a time processing. + - @todo Add annotation to Predicate to indicate the use of an RMI access path in scale-out. Modify PipelineJoin such that it can be used as an ANY operator -or- a SHARDED operator. For default graph @@ -318,9 +334,6 @@ ==== Features: - - (***) Fix termination problems in RunningQuery relating to binding - set chunk / chunk message multiplicity. - - operator-at-once evaluation. The operator is triggered once its possible triggers are done. This is just an application of the same utility method which we use to decide when a query is done. @@ -350,7 +363,6 @@ used for fast computation of the delta between two historical commit points. - * FIXME Unit tests for non-distinct {@link IElementFilter}s on an * {@link IPredicate}, unit tests for distinct element filter on an * {@link IPredicate} which is capable of distributed operations. Do not use Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/JoinGraph.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/JoinGraph.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/JoinGraph.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -34,9 +34,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; -import com.bigdata.bop.BOp; import com.bigdata.bop.BOpContext; -import com.bigdata.bop.BOpEvaluationContext; import com.bigdata.bop.BindingSetPipelineOp; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.IPredicate; @@ -189,6 +187,15 @@ if (sampleSize <= 0) throw new IllegalArgumentException(); + switch (getEvaluationContext()) { + case CONTROLLER: + break; + default: + throw new UnsupportedOperationException( + Annotations.EVALUATION_CONTEXT + "=" + + getEvaluationContext()); + } + V = new Vertex[v.length]; for (int i = 0; i < v.length; i++) { @@ -263,14 +270,4 @@ } - /** - * This operator must be evaluated on the query controller. - */ - @Override - public BOpEvaluationContext getEvaluationContext() { - - return BOpEvaluationContext.CONTROLLER; - - } - } Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -87,6 +87,12 @@ * Note: In order to support pipelining, query plans need to be arranged in a * "left-deep" manner and there may not be intervening operators between the * pipeline join operator and the {@link IPredicate} on which it will read. + * <p> + * Note: In scale-out, the {@link PipelineJoin} is generally annotated as a + * {@link BOpEvaluationContext#SHARDED} or {@link BOpEvaluationContext#HASHED} + * operator and the {@link IPredicate} is annotated for local access paths. If + * you need to use remote access paths, then the {@link PipelineJoin} should be + * annotated as a {@link BOpEvaluationContext#ANY} operator. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ @@ -278,15 +284,15 @@ } - /** - * Returns {@link BOpEvaluationContext#SHARDED} - */ - @Override - final public BOpEvaluationContext getEvaluationContext() { - - return BOpEvaluationContext.SHARDED; - - } + // /** + // * Returns {@link BOpEvaluationContext#SHARDED} + // */ + // @Override + // final public BOpEvaluationContext getEvaluationContext() { + // + // return BOpEvaluationContext.SHARDED; + // + // } public IPredicate<E> getPredicate() { @@ -339,14 +345,14 @@ public FutureTask<Void> eval(final BOpContext<IBindingSet> context) { - return new FutureTask<Void>(new JoinTask(this, context)); + return new FutureTask<Void>(new JoinTask<E>(this, context)); } /** * Pipeline join impl. */ - private static class JoinTask extends Haltable<Void> implements Callable<Void> { + private static class JoinTask<E> extends Haltable<Void> implements Callable<Void> { /** * The join that is being executed. @@ -394,12 +400,12 @@ /** * The source for the elements to be joined. */ - final private IPredicate<?> right; + final private IPredicate<E> right; /** * The relation associated with the {@link #right} operand. */ - final private IRelation<?> relation; + final private IRelation<E> relation; /** * The partition identifier -or- <code>-1</code> if we are not reading @@ -476,7 +482,7 @@ * @param context */ public JoinTask(// - final PipelineJoin<?> joinOp,// + final PipelineJoin<E> joinOp,// final BOpContext<IBindingSet> context ) { @@ -851,7 +857,7 @@ * Aggregate the source bindingSets that license the same * asBound predicate. */ - final Map<IPredicate<?>, Collection<IBindingSet>> map = combineBindingSets(chunk); + final Map<IPredicate<E>, Collection<IBindingSet>> map = combineBindingSets(chunk); /* * Generate an AccessPathTask from each distinct asBound @@ -898,7 +904,7 @@ final IBindingSet bindingSet = chunk[0]; // constrain the predicate to the given bindings. - IPredicate<?> predicate = right.asBound(bindingSet); + IPredicate<E> predicate = right.asBound(bindingSet); if (partitionId != -1) { @@ -917,7 +923,8 @@ } - new AccessPathTask(predicate,Arrays.asList(chunk)).call(); + new JoinTask.AccessPathTask(predicate, Arrays.asList(chunk)) + .call(); } @@ -937,13 +944,13 @@ * bindingSets in the chunk from which the predicate was * generated. */ - protected Map<IPredicate<?>, Collection<IBindingSet>> combineBindingSets( + protected Map<IPredicate<E>, Collection<IBindingSet>> combineBindingSets( final IBindingSet[] chunk) { if (log.isDebugEnabled()) log.debug("chunkSize=" + chunk.length); - final Map<IPredicate<?>, Collection<IBindingSet>> map = new LinkedHashMap<IPredicate<?>, Collection<IBindingSet>>( + final Map<IPredicate<E>, Collection<IBindingSet>> map = new LinkedHashMap<IPredicate<E>, Collection<IBindingSet>>( chunk.length); for (IBindingSet bindingSet : chunk) { @@ -951,7 +958,7 @@ halted(); // constrain the predicate to the given bindings. - IPredicate<?> predicate = right.asBound(bindingSet); + IPredicate<E> predicate = right.asBound(bindingSet); if (partitionId != -1) { @@ -1025,16 +1032,16 @@ * @throws Exception */ protected AccessPathTask[] getAccessPathTasks( - final Map<IPredicate<?>, Collection<IBindingSet>> map) { + final Map<IPredicate<E>, Collection<IBindingSet>> map) { final int n = map.size(); if (log.isDebugEnabled()) log.debug("#distinct predicates=" + n); - final AccessPathTask[] tasks = new AccessPathTask[n]; + final AccessPathTask[] tasks = new JoinTask.AccessPathTask[n]; - final Iterator<Map.Entry<IPredicate<?>, Collection<IBindingSet>>> itr = map + final Iterator<Map.Entry<IPredicate<E>, Collection<IBindingSet>>> itr = map .entrySet().iterator(); int i = 0; @@ -1043,7 +1050,7 @@ halted(); - final Map.Entry<IPredicate<?>, Collection<IBindingSet>> entry = itr + final Map.Entry<IPredicate<E>, Collection<IBindingSet>> entry = itr .next(); tasks[i++] = new AccessPathTask(entry.getKey(), entry @@ -1203,7 +1210,7 @@ * {@link IPredicate} for this join dimension. The asBound * {@link IPredicate} is {@link IAccessPath#getPredicate()}. */ - final private IAccessPath<?> accessPath; + final private IAccessPath<E> accessPath; /** * Return the <em>fromKey</em> for the {@link IAccessPath} generated @@ -1215,7 +1222,7 @@ */ protected byte[] getFromKey() { - return ((AccessPath<?>) accessPath).getFromKey(); + return ((AccessPath<E>) accessPath).getFromKey(); } @@ -1239,7 +1246,7 @@ if (this == o) return true; - if (!(o instanceof AccessPathTask)) + if (!(o instanceof JoinTask.AccessPathTask)) return false; return accessPath.getPredicate().equals( @@ -1262,7 +1269,7 @@ * join dimension that all result in the same asBound * {@link IPredicate}. */ - public AccessPathTask(final IPredicate<?> predicate, + public AccessPathTask(final IPredicate<E> predicate, final Collection<IBindingSet> bindingSets) { if (predicate == null) Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/mutation/InsertOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/mutation/InsertOp.java 2010-09-24 19:37:50 UTC (rev 3629) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/mutation/InsertOp.java 2010-09-25 00:31:32 UTC (rev 3630) @@ -33,7 +33,6 @@ import com.bigdata.bop.BOp; import com.bigdata.bop.BOpContext; -import com.bigdata.bop.BOpEvaluationContext; import com.bigdata.bop.BindingSetPipelineOp; import com.bigdata.bop.IBindingSet; import com.bigdata.bop.IPredicate; @@ -44,7 +43,6 @@ import com.bigdata.btree.UnisolatedReadWriteIndex; import com.bigdata.btree.keys.IKeyBuilder; import com.bigdata.journal.IIndexManager; -import com.bigdata.journal.ITx; import com.bigdata.relation.IRelation; import com.bigdata.relation.accesspath.IAsynchronousIterator; import com.bigdata.relation.accesspath.IBlockingBuffer; @@ -293,6 +291,9 @@ * * FIXME This must obtain the appropriate lock for the mutable * index in scale-out. + * + * FIXME Allow remote writes as well if a remote access path is + * marked on the {@link IPredicate}. */ public <T> ILocalBTreeView getMu... [truncated message content] |
From: <res...@us...> - 2010-09-24 19:38:00
|
Revision: 3629 http://bigdata.svn.sourceforge.net/bigdata/?rev=3629&view=rev Author: resendes Date: 2010-09-24 19:37:50 +0000 (Fri, 24 Sep 2010) Log Message: ----------- Merge from maven_scaleout branch Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/BTree.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/view/FusedView.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/AbstractBufferStrategy.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/Journal.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/RWStrategy.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/TemporaryRawStore.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/IRawStore.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/SimpleMemoryRawStore.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/BuildResult.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/service/jini/util/DumpFederation.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/service/jini/util/LookupStarter.java branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/test.xml branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/btree/TestAll_IndexSegment.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/btree/TestBTree.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/btree/TestTransientBTree.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/journal/ReplicatedStore.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/rawstore/SimpleFileRawStore.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/resources/AbstractResourceManagerTestCase.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/resources/TestReleaseResources.java branches/bbb_cleanup/bigdata-integ/pom.xml branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/jini/start/AbstractFedZooTestCase.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/jini/start/TestJiniCoreServicesProcessHelper.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/jini/start/TestServiceConfigurationMonitoring.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/jini/start/TestServiceConfigurationZNodeEnum.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/jini/start/TestServiceStarter.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/service/jini/AbstractServerTestCase.java branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/service/jini/TestBigdataClient.java branches/bbb_cleanup/pom.xml Added Paths: ----------- branches/bbb_cleanup/bigdata-core/build/ branches/bbb_cleanup/bigdata-core/build/classes/ branches/bbb_cleanup/bigdata-core/src/META-INF/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/SimpleResourceMetadata.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java branches/bbb_cleanup/bigdata-integ/src/test/resources/services.xml Removed Paths: ------------- branches/bbb_cleanup/bigdata-integ/src/test/java/com/bigdata/test/util/Assert.java Property Changed: ---------------- branches/bbb_cleanup/ branches/bbb_cleanup/bigdata-core/ branches/bbb_cleanup/bigdata-core/bigdata-perf/ branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources/ branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL/ branches/bbb_cleanup/bigdata-core/dsi-utils/lib/ branches/bbb_cleanup/bigdata-core/dsi-utils/src/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ branches/bbb_cleanup/bigdata-core/osgi/ branches/bbb_cleanup/bigdata-core/src/main/deploy/bin/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/ branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties branches/bbb_cleanup/bigdata-core/src/main/java/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench/ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util/ branches/bbb_cleanup/bigdata-core/src/samples-sail/com/bigdata/samples/fastload.properties branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/conf/bigdataStandaloneTesting.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/config/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/jini/start/testfed.config branches/bbb_cleanup/bigdata-core/src/test/deploy/testing/data/com/bigdata/service/jini/master/TestMappedRDFDataLoadMaster.config branches/bbb_cleanup/bigdata-core/src/test/java/ Property changes on: branches/bbb_cleanup ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3607 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-3440,3443,3463,3469-3470 /branches/fko:3150-3194 /branches/maven_scaleout:3379-3438,3588-3628 /trunk:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core:3588-3607 /trunk:3499 + /branches/maven_scaleout/bigdata-core:3588-3628 /trunk:3499 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3607 /trunk/bigdata-perf:3379-3541 + /branches/maven_scaleout/bigdata-core/bigdata-perf:3588-3628 /trunk/bigdata-perf:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/bigdata-perf/lubm/src/resources ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3607 /trunk/bigdata-perf/lubm/src/resources:3379-3541 + /branches/dev-btm/bigdata-perf/lubm/src/resources:2574-3440 /branches/maven_scaleout/bigdata-core/bigdata-perf/lubm/src/resources:3588-3628 /trunk/bigdata-perf/lubm/src/resources:3379-3541 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/LEGAL ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3607 /trunk/dsi-utils/LEGAL:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/LEGAL:3588-3628 /trunk/dsi-utils/LEGAL:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/lib ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3607 /trunk/dsi-utils/lib:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/lib:3588-3628 /trunk/dsi-utils/lib:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/dsi-utils/src ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3607 /trunk/dsi-utils/src:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/dsi-utils/src:3588-3628 /trunk/dsi-utils/src:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3607 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3588-3628 /trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3607 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3588-3628 /trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/osgi ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/osgi:3588-3607 /trunk/osgi:3379-3430,3499 + /branches/maven_scaleout/bigdata-core/osgi:3588-3628 /trunk/osgi:3379-3430,3499 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/bin ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3607 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/bin:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/bin:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/bin:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/bin:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/bin:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/bin:3463 /branches/fko/bigdata-core/src/main/deploy/bin:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/bin:3588-3628 /trunk/bigdata-core/src/main/deploy/bin:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini ___________________________________________________________________ Modified: svn:mergeinfo - /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3607 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 + /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini:3588-3628 /trunk/src/main/deploy/var/config/jini:3499 /trunk/src/resources/config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/src/resources/config/bigdataCluster.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/bigdataCluster.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/src/resources/config/bigdataCluster.config:3516-3528 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/boot ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/boot:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/boot:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/boot:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/boot/config:3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/boot:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3438,3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/boot:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2594-3237 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/shardlocator.config:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/jini/shardlocator.config:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging:2594-3237 /branches/dev-btm/bigdata/src/resources/logging:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging:2574-3440,3443,3463,3469-3470 /branches/fko/bigdata-core/src/main/deploy/var/config/logging:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/shardlocator-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/metadata/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging/shardlocator-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3607 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2594-3237 /branches/dev-btm/bigdata/src/resources/logging/transaction-logging.properties:3463 /branches/dev-btm/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java/com/bigdata/transaction/config/logging.properties:3463 /branches/fko/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3588-3628 /trunk/bigdata-core/src/main/deploy/var/config/logging/transaction-logging.properties:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3607 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 + /branches/BTREE_BUFFER_BRANCH/bigdata-core/src/main/java:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-core/src/main/java:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH/bigdata-core/src/main/java:2633-3304 /branches/bugfix-btm/bigdata-core/src/main/java:2594-3237 /branches/dev-btm/bigdata/src/java:3463 /branches/dev-btm/bigdata-core/src/main/java:2574-3440,3443,3463,3469-3470 /branches/dev-btm/bigdata-jini/src/java:3463,3469-3470 /branches/dev-btm/bigdata-rdf/src/java:3463 /branches/dev-btm/bigdata-sails/src/java:3463 /branches/fko/bigdata-core/src/main/java:3150-3194 /branches/maven_scaleout/bigdata-core/src/main/java:3588-3628 /trunk/bigdata/src/java:3507 /trunk/bigdata-core/src/main/java:3379-3430,3432-3460,3476-3499,3503,3507,3516-3528,3542 /trunk/bigdata-rdf/src/java:3542 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/attr ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3607 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/attr:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/attr:3588-3628 /trunk/bigdata-jini/src/java/com/bigdata/attr:3379-3430 Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -52,7 +52,6 @@ import com.bigdata.btree.IndexMetadata.Options; import com.bigdata.btree.IndexSegment.IndexSegmentTupleCursor; import com.bigdata.btree.data.IAbstractNodeData; -import com.bigdata.btree.data.ILeafData; import com.bigdata.btree.data.INodeData; import com.bigdata.btree.filter.IFilterConstructor; import com.bigdata.btree.filter.Reverserator; @@ -68,7 +67,6 @@ import com.bigdata.cache.HardReferenceQueueWithBatchingUpdates; import com.bigdata.cache.IHardReferenceQueue; import com.bigdata.cache.RingBuffer; -import com.bigdata.cache.IGlobalLRU.ILRUCache; import com.bigdata.counters.CounterSet; import com.bigdata.counters.ICounterSet; import com.bigdata.counters.Instrument; @@ -1337,7 +1335,7 @@ */ abstract public IRawStore getStore(); - final public IResourceMetadata[] getResourceMetadata() { + public IResourceMetadata[] getResourceMetadata() { if (store == null) { @@ -1353,14 +1351,12 @@ }; + } else { + //This is a default metadata, appropriate for rawstores. + return new IResourceMetadata[] { + new SimpleResourceMetadata(store.getUUID()) + }; } - - return new IResourceMetadata[] { - - store.getResourceMetadata() - - }; - } /** Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/BTree.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/BTree.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/BTree.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -190,6 +190,11 @@ } + public final IResourceMetadata[] getResourceMetadata() { + //override to make final so sub-classes cannot modify behavior. + return super.getResourceMetadata(); + } + /** * Returns an {@link ICounter}. The {@link ICounter} is mutable iff the * {@link BTree} is mutable. All {@link ICounter}s returned by this method Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -34,6 +34,7 @@ import com.bigdata.btree.raba.ReadOnlyValuesRaba; import com.bigdata.io.AbstractFixedByteArrayBuffer; import com.bigdata.io.FixedByteArrayBuffer; +import com.bigdata.mdi.IResourceMetadata; import com.bigdata.service.Event; import com.bigdata.service.EventResource; import com.bigdata.service.EventType; @@ -676,6 +677,13 @@ } + public final IResourceMetadata[] getResourceMetadata() { + //Overrides the default returned metadata, providing IndexSegmentStore specific metadata. + return new IResourceMetadata[] { + fileStore.getResourceMetadata() + }; + } + /* * INodeFactory */ Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -37,10 +37,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; +import com.bigdata.journal.IStoreFile; import org.apache.log4j.Logger; import com.bigdata.cache.IGlobalLRU; -import com.bigdata.cache.IGlobalLRU.ILRUCache; import com.bigdata.counters.CounterSet; import com.bigdata.counters.Instrument; import com.bigdata.counters.OneShotInstrument; @@ -67,7 +67,7 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public class IndexSegmentStore extends AbstractRawStore { +public class IndexSegmentStore extends AbstractRawStore implements IStoreFile { /** * Logger. Copied: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/SimpleResourceMetadata.java (from rev 3628, branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/SimpleResourceMetadata.java) =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/SimpleResourceMetadata.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/SimpleResourceMetadata.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -0,0 +1,104 @@ +/* + * Created by IntelliJ IDEA. + * User: gossard + * Date: Sep 22, 2010 + * Time: 2:40:37 PM + */ +package com.bigdata.btree; + +import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.rawstore.SimpleMemoryRawStore; + +import java.util.UUID; + +/** + * Dumb metadata object, used by a btree to return metadata about rawstores. + * This class was previously an inner-class in {@link com.bigdata.rawstore.SimpleMemoryRawStore SimpleMemoryRawStore}, + * but was moved into the btree package to remove a rawstore dependency on the mdi package. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + */ +public class SimpleResourceMetadata implements IResourceMetadata { + + /** + * + */ + private static final long serialVersionUID = -8333003625527191826L; + + private final UUID uuid; + + public SimpleResourceMetadata(UUID uuid) { + if (uuid == null) + throw new NullPointerException("uuid cannot be null"); + this.uuid = uuid; + } + + @Override + public int hashCode() { + return uuid.hashCode(); + } + + //from java.lang.Object + public boolean equals(Object obj){ + if (obj instanceof SimpleResourceMetadata){ + SimpleResourceMetadata other = (SimpleResourceMetadata)obj; + return uuid.equals(other.uuid); + } else + return false; + } + + //from com.bigdata.mdi.IResourceMetadata, *NOT* java.lang.Object + public boolean equals(IResourceMetadata o) { + + return this.equals((Object)o); + } + + public long getCreateTime() { + + // does not support commit + return 0L; + + } + + public long getCommitTime() { + + // does not support commit + return 0L; + + } + + public String getFile() { + + // no backing file. + return null; + + } + + public UUID getUUID() { + + return uuid; + + } + + public boolean isIndexSegment() { + + // not index segment. + return false; + + } + + public boolean isJournal() { + + // not journal. + return false; + + } + +// public long size() { +// +// // #of bytes not available. +// return 0L; +// +// } + +} \ No newline at end of file Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/view/FusedView.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/view/FusedView.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/btree/view/FusedView.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -399,7 +399,11 @@ for(AbstractBTree t : sources) { // for (int i = 0; i < srcs.length; i++) { - resources[i++] = t.getStore().getResourceMetadata(); + IResourceMetadata[] metaAboutBTree = t.getResourceMetadata(); + if (metaAboutBTree.length == 1) + resources[i++] = metaAboutBTree[0]; + else + throw new RuntimeException("BTree had wrong number of metadata items, should have been caught in unit tests."); } Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/disco ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3607 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 + /branches/dev-btm/bigdata-jini/src/java/com/bigdata/disco:3463,3469-3470 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/disco:3588-3628 /trunk/bigdata-jini/src/java/com/bigdata/disco:3379-3430 Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/AbstractBufferStrategy.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/AbstractBufferStrategy.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/AbstractBufferStrategy.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -585,18 +585,6 @@ } /** - * Not supported - this is available on the {@link AbstractJournal}. - * - * @throws UnsupportedOperationException - * always - */ - public IResourceMetadata getResourceMetadata() { - - throw new UnsupportedOperationException(); - - } - - /** * Sets the <code>readOnly</code> flag. * <p> * Note: This method SHOULD be extended to release write caches, etc. Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -25,7 +25,6 @@ import java.util.Properties; -import com.bigdata.btree.keys.IKeyBuilderFactory; import com.bigdata.rawstore.IMRMW; /** @@ -38,7 +37,7 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public interface IJournal extends IMRMW, IAtomicStore, IBTreeManager { +public interface IJournal extends IMRMW, IAtomicStore, IBTreeManager, IStoreFile { /** * A copy of the properties used to initialize this journal. Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -40,7 +40,6 @@ import com.bigdata.btree.IndexSegmentStore; import com.bigdata.btree.view.FusedView; import com.bigdata.counters.CounterSet; -import com.bigdata.rawstore.IRawStore; import com.bigdata.resources.ResourceManager; import com.bigdata.resources.StaleLocatorException; import com.bigdata.resources.StaleLocatorReason; @@ -99,17 +98,17 @@ public AbstractJournal getJournal(long timestamp); /** - * Opens an {@link IRawStore}. + * Opens an {@link IStoreFile}. * * @param uuid * The UUID identifying that store file. * - * @return The open {@link IRawStore}. + * @return The open {@link IStoreFile}. * * @throws RuntimeException * if something goes wrong. */ - public IRawStore openStore(UUID uuid); + public IStoreFile openStore(UUID uuid); /** * Return the ordered {@link AbstractBTree} sources for an index or a view Copied: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java (from rev 3628, branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java) =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -0,0 +1,53 @@ +/* + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +package com.bigdata.journal; + +import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.rawstore.IRawStore; + +import com.bigdata.btree.IndexSegmentStore; +import com.bigdata.journal.IJournal; + +/** + * An {@link IRawStore} that exposes additional serializable metadata allowing it to be managed by an + * {@link IResourceManager}. Currently this is common interface between the two main store + * file types that are used to store btree indices. + * <b /> + * The methods on this interface have been moved from <code>IRawStore</code> in order to reduce the burden on + * rawstore implementations which we often needed to stub methods out even though they were never used. + * It also improves encapsulation by removing direct knowledge of resource management related classes in the rawstore + * package. + * + * {@see IndexSegmentStore} + * {@see IJournal} + */ +public interface IStoreFile extends IRawStore { + + /** + * A description of this store in support of the scale-out architecture. + */ + public IResourceMetadata getResourceMetadata(); +} Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/Journal.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/Journal.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/Journal.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -49,7 +49,6 @@ import com.bigdata.config.IntegerValidator; import com.bigdata.config.LongValidator; import com.bigdata.counters.CounterSet; -import com.bigdata.rawstore.IRawStore; import com.bigdata.relation.locator.DefaultResourceLocator; import com.bigdata.relation.locator.ILocatableResource; import com.bigdata.relation.locator.IResourceLocator; @@ -292,7 +291,7 @@ * Note: This will only succeed if the <i>uuid</i> identifies <i>this</i> * journal. */ - public IRawStore openStore(final UUID uuid) { + public IStoreFile openStore(final UUID uuid) { if(uuid == getRootBlockView().getUUID()) { Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/RWStrategy.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/RWStrategy.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/RWStrategy.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -479,10 +479,6 @@ return m_fileMetadata.raf; } - public IResourceMetadata getResourceMetadata() { - // TODO Auto-generated method stub - return null; - } public UUID getUUID() { return m_fileMetadata.rootBlock.getUUID(); Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/TemporaryRawStore.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/TemporaryRawStore.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/journal/TemporaryRawStore.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -400,61 +400,6 @@ } - /** - * Note: Temporary stores do not have persistent resource descriptions. - */ - final public IResourceMetadata getResourceMetadata() { - - final File file = buf.getFile(); - - final String fileStr = file == null ? "" : file.toString(); - - return new ResourceMetadata(this, fileStr); - - } - - /** - * Static class since must be {@link Serializable}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ - static final class ResourceMetadata extends AbstractResourceMetadata { - - /** - * De-serializator ctor. - */ - public ResourceMetadata() { - - } - - public ResourceMetadata(final TemporaryRawStore store, - final String fileStr) { - - super(fileStr, // store.buf.getExtent() - store.uuid,// - store.createTime, // - 0L// commitTime - ); - - } - - private static final long serialVersionUID = 1L; - - public boolean isJournal() { - - return false; - - } - - public boolean isIndexSegment() { - - return false; - - } - - } - final public DiskOnlyStrategy getBufferStrategy() { return buf; Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/IRawStore.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/IRawStore.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/IRawStore.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -36,7 +36,6 @@ import com.bigdata.counters.CounterSet; import com.bigdata.io.IByteArrayBuffer; import com.bigdata.journal.AbstractJournal; -import com.bigdata.mdi.IResourceMetadata; /** * <p> @@ -242,12 +241,7 @@ * Return the {@link UUID} which identifies this {@link IRawStore}. This * supports {@link #getResourceMetadata()} */ - public UUID getUUID(); - - /** - * A description of this store in support of the scale-out architecture. - */ - public IResourceMetadata getResourceMetadata(); + public UUID getUUID(); /** * True iff backed by stable storage. Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/SimpleMemoryRawStore.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/SimpleMemoryRawStore.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rawstore/SimpleMemoryRawStore.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -28,7 +28,6 @@ package com.bigdata.rawstore; import java.io.File; -import java.io.Serializable; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.HashMap; @@ -37,8 +36,6 @@ import java.util.concurrent.ExecutorService; import com.bigdata.counters.CounterSet; -import com.bigdata.journal.TemporaryRawStore; -import com.bigdata.mdi.IResourceMetadata; /** * A purely transient append-only implementation useful when data need to be @@ -48,7 +45,7 @@ * implementation does not contain things like {@link ExecutorService}s that * would hang around unless explicitly shutdown. * - * @see {@link TemporaryRawStore}, which provides a more scalable solution for + * @see {@link com.bigdata.journal.TemporaryRawStore TemporaryRawStore}, which provides a more scalable solution for * temporary data. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> @@ -147,91 +144,8 @@ return uuid; } - - public IResourceMetadata getResourceMetadata() { - return new ResourceMetadata(uuid); - - } - /** - * Static class since must be {@link Serializable}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ - private static class ResourceMetadata implements IResourceMetadata { - - /** - * - */ - private static final long serialVersionUID = -8333003625527191826L; - - private final UUID uuid; - - public ResourceMetadata(UUID uuid) { - - this.uuid = uuid; - - } - - public boolean equals(IResourceMetadata o) { - - return this == o; - - } - - public long getCreateTime() { - - // does not support commit - return 0L; - - } - - public long getCommitTime() { - - // does not support commit - return 0L; - - } - - public String getFile() { - - // no backing file. - return null; - - } - - public UUID getUUID() { - - return uuid; - - } - - public boolean isIndexSegment() { - - // not index segment. - return false; - - } - - public boolean isJournal() { - - // not journal. - return false; - - } - -// public long size() { -// -// // #of bytes not available. -// return 0L; -// -// } - - } - - /** * This always returns <code>null</code>. */ public File getFile() { Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3607 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 + /branches/dev-btm/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/sail/bench:3588-3628 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench:3379-3430 Property changes on: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/rdf/util ___________________________________________________________________ Modified: svn:mergeinfo - /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3607 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 + /branches/dev-btm/bigdata-rdf/src/java/com/bigdata/rdf/util:3463 /branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/rdf/util:3588-3628 /trunk/bigdata-rdf/src/java/com/bigdata/rdf/util:3379-3430,3542 Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/BuildResult.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/BuildResult.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/BuildResult.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -126,9 +126,11 @@ this.sources = new IResourceMetadata[sourceCount]; for (int i = 0; i < sourceCount; i++) { - - this.sources[i] = sources[i].getStore().getResourceMetadata(); - + IResourceMetadata[] metaAboutBTree = sources[i].getResourceMetadata(); + if (metaAboutBTree.length == 1) + this.sources[i] = metaAboutBTree[0]; + else + throw new RuntimeException("BTree had wrong number of metadata items, should have been caught in unit tests."); } this.segmentMetadata = segmentMetadata; Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -42,6 +42,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Lock; +import com.bigdata.journal.*; import org.apache.log4j.Logger; import com.bigdata.btree.AbstractBTree; @@ -66,24 +67,12 @@ import com.bigdata.counters.CounterSet; import com.bigdata.counters.ICounterSet; import com.bigdata.io.DataInputBuffer; -import com.bigdata.journal.AbstractJournal; -import com.bigdata.journal.AbstractTask; -import com.bigdata.journal.ConcurrencyManager; -import com.bigdata.journal.ICommitRecord; -import com.bigdata.journal.IJournal; -import com.bigdata.journal.ITx; -import com.bigdata.journal.Journal; -import com.bigdata.journal.Name2Addr; -import com.bigdata.journal.NoSuchIndexException; -import com.bigdata.journal.TimestampUtility; -import com.bigdata.journal.Tx; import com.bigdata.journal.Name2Addr.Entry; import com.bigdata.journal.Name2Addr.EntrySerializer; import com.bigdata.mdi.IResourceMetadata; import com.bigdata.mdi.LocalPartitionMetadata; import com.bigdata.mdi.SegmentMetadata; import com.bigdata.rawstore.Bytes; -import com.bigdata.rawstore.IRawStore; import com.bigdata.service.Event; import com.bigdata.service.EventType; import com.bigdata.service.IBigdataClient; @@ -134,11 +123,11 @@ * Note: The {@link IIndex}s managed by this class are a * {@link FusedView} of {@link AbstractBTree}s. Each * {@link AbstractBTree} has a hard reference to the backing - * {@link IRawStore} and will keep the {@link IRawStore} from being + * {@link com.bigdata.journal.IStoreFile} and will keep the {@link IStoreFile} from being * finalized as long as a hard reference exists to the - * {@link AbstractBTree} (the reverse is not true - an {@link IRawStore} + * {@link AbstractBTree} (the reverse is not true - an {@link IStoreFile} * reference does NOT hold a hard reference to {@link AbstractBTree}s - * on that {@link IRawStore}). + * on that {@link IStoreFile}). * <p> * Note: The retention of the {@link BTree}s on the live * {@link ManagedJournal}s is governed by @@ -923,7 +912,7 @@ * {@link StoreManager#openStores}. */ public AbstractBTree getIndexOnStore(final String name, - final long timestamp, final IRawStore store) { + final long timestamp, final IStoreFile store) { if (name == null) throw new IllegalArgumentException(); @@ -1232,7 +1221,7 @@ final IResourceMetadata resource = a[i]; - final IRawStore store; + final IStoreFile store; try { store = openStore(resource.getUUID()); @@ -2021,7 +2010,7 @@ /** * Canonical per-index partition {@link BTreeCounters}. These counters are * set on each {@link AbstractBTree} that is materialized by - * {@link #getIndexOnStore(String, long, IRawStore)}. The same + * {@link #getIndexOnStore(String, long, IStoreFile)}. The same * {@link BTreeCounters} object is used for the unisolated, read-committed, * read-historical and isolated views of the index partition and for each * source in the view regardless of whether the source is a mutable Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java 2010-09-24 18:26:07 UTC (rev 3628) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java 2010-09-24 19:37:50 UTC (rev 3629) @@ -44,13 +44,13 @@ import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import com.bigdata.journal.*; import org.apache.log4j.Logger; import com.bigdata.bfs.BigdataFileSystem; @@ -67,25 +67,7 @@ import com.bigdata.cache.IGlobalLRU.ILRUCache; import com.bigdata.concurrent.NamedLock; import com.bigdata.io.SerializerUtil; -import com.bigdata.journal.AbstractJournal; -import com.bigdata.journal.AbstractLocalTransactionManager; -import com.bigdata.journal.BufferMode; -import com.bigdata.journal.CommitRecordIndex; -import com.bigdata.journal.ConcurrencyManager; -import com.bigdata.journal.DiskOnlyStrategy; -import com.bigdata.journal.IBufferStrategy; -import com.bigdata.journal.ICommitRecord; -import com.bigdata.journal.IConcurrencyManager; -import com.bigdata.journal.ILocalTransactionManager; -import com.bigdata.journal.IResourceLockService; -import com.bigdata.journal.IResourceManager; -import com.bigdata.journal.IRootBlockView; //BTM import com.bigdata.journal.ITransactionService; -import com.bigdata.journal.ITx; -import com.bigdata.journal.Name2Addr; -import com.bigdata.journal.TemporaryStore; -import com.bigdata.journal.WORMStrategy; -import com.bigdata.journal.WriteExecutorService; import com.bigdata.journal.WORMStrategy.StoreCounters; import com.bigdata.mdi.IPartitionMetadata; import com.bigdata.mdi.IResourceMetadata; @@ -94,7 +76,6 @@ import com.bigdata.mdi.LocalPartitionMetadata; import com.bigdata.mdi.SegmentMetadata; import com.bigdata.rawstore.Bytes; -import com.bigdata.rawstore.IRawStore; import com.bigdata.relation.locator.DefaultResourceLocator; import com.bigdata.service.DataService; import com.bigdata.service.Event; @@ -108,8 +89,8 @@ import static java.util.concurrent.TimeUnit.*; //BTM -import com.bigdata.journal.TransactionService; + /** * Class encapsulates logic for managing the store files (journals and index * segments), including the logic to compute the effective release time for the @@ -178,7 +159,7 @@ String DATA_DIR = StoreManager.class.getName()+".dataDir"; /** - * The capacity of the LRU cache of open {@link IRawStore}s. The + * The capacity of the LRU cache of open {@link IStoreFile}s. The * capacity of this cache indirectly controls how many stores will be * held open. The main reason for keeping an store open is to reuse its * buffers if another request arrives "soon" which would read on that @@ -213,7 +194,7 @@ * The time in milliseconds before an entry in the store cache will be * cleared from the backing {@link HardReferenceQueue} (default * {@value #DEFAULT_STORE_CACHE_TIMEOUT}). This property controls how - * long the store cache will retain an {@link IRawStore} which has not + * long the store cache will retain an {@link IStoreFile} which has not * been recently used. This is in contrast to the cache capacity. */ String STORE_CACHE_TIMEOUT = StoreManager.class.... [truncated message content] |
From: <res...@us...> - 2010-09-24 18:26:15
|
Revision: 3628 http://bigdata.svn.sourceforge.net/bigdata/?rev=3628&view=rev Author: resendes Date: 2010-09-24 18:26:07 +0000 (Fri, 24 Sep 2010) Log Message: ----------- - Continued clean-up of com.bigdata.util.* - Removed unreferenced/unused classes - Added tests and support classes for CSVReader Modified Paths: -------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/CSVReader.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestCSVReader.java Added Paths: ----------- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/CSVReaderBuilder.java Removed Paths: ------------- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ByteBufferBitVector.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ChecksumError.java branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ClassLoaderUtil.java branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestByteBufferBitVector.java Deleted: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ByteBufferBitVector.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ByteBufferBitVector.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ByteBufferBitVector.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -1,167 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Aug 6, 2009 - */ - -package com.bigdata.util; - -import it.unimi.dsi.bits.AbstractBitVector; - -import java.nio.ByteBuffer; - -import cern.colt.bitvector.BitVector; - -/** - * Wraps a {@link ByteBuffer} as a read-only {@link BitVector}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class ByteBufferBitVector extends AbstractBitVector { - - /** - * The {@link ByteBuffer} containing the backing data. - */ - final private ByteBuffer b; - - /** - * The #of bits in the vector. - */ - private final long len; - - /** - * The bit offset into the {@link ByteBuffer} of the first bit in the - * vector. - */ - private final long off; - - final public long length() { - - return len; - - } - - /** - * Ctor assumes that all bits in the buffer are used. - * - * @param b - * The buffer. - */ - public ByteBufferBitVector(final ByteBuffer b) { - - this(b, 0/* offset */, b == null ? 0 : b.capacity() * 8/* len */); - - } - - /** - * - * @param b - * The buffer. - * @param off - * The offset from the start of the buffer for the view. - * @param len - * The #of bits which will be included in the view. - */ - public ByteBufferBitVector(final ByteBuffer b, final long off, - final long len) { - - if (b == null) - throw new IllegalArgumentException(); - - if (len < 0) - throw new IllegalArgumentException(); - - if (len < 0) - throw new IllegalArgumentException(); - - if (off + len > b.capacity() * 8L) - throw new IllegalArgumentException(); - - this.b = b; - - this.len = len; - - this.off = off; - - } - - /** - * Return the index of the byte in which the bit with the given index is - * encoded. - * - * @param bitIndex - * The bit index. - * - * @return The byte index. - */ - final protected int byteIndexForBit(final long bitIndex) { - - return ((int) ((bitIndex + off) / 8)); - - } - - /** - * Return the offset within the byte in which the bit is coded of the bit - * (this is just the remainder <code>bitIndex % 8</code>). - * - * @param bitIndex - * The bit index into the byte[]. - * - * @return The offset of the bit in the appropriate byte. - */ - final protected int withinByteIndexForBit(final long bitIndex) { - - return (int) ((bitIndex + off) % 8); - - } - - /** - * Extract and return a bit coded flag. - * - * @param offset - * The offset in the buffer of the start of the byte[] sequence - * in which the bit coded flags are stored. - * @param index - * The index of the bit. - * - * @return The value of the bit. - */ - public boolean getBoolean(final long index) { - - if (index < 0 || index >= len) - throw new IndexOutOfBoundsException(); - - return (b.get(byteIndexForBit(index)) & (1 << withinByteIndexForBit(index))) != 0; - - } - -// // @todo override for mutation. -// public boolean set(final long index, final boolean value) { -// -// throw new UnsupportedOperationException(); -// -// } - -} Modified: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/CSVReader.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/CSVReader.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/CSVReader.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -93,10 +93,8 @@ private final String name; - public String getName() { - - return name; - + public String getName() { + return name; } /** @@ -227,25 +225,29 @@ } /** - * Equal if the headers have the same data. + * Equal if the headers have the same name. */ - public boolean equals(Header o) { + @Override + public boolean equals(Object o) { + if (!(o instanceof Header)) + return false; + + Header h = (Header)o; - if(this==o) return true; - - return name.equals(o.name); - + return name.equals(h.name); } /** * Based on the header name. */ + @Override public int hashCode() { return name.hashCode(); } + @Override public String toString() { return name; @@ -324,54 +326,54 @@ } - public boolean setSkipCommentLines(boolean skipCommentLines) { +// public boolean setSkipCommentLines(boolean skipCommentLines) { +// +// boolean tmp = this.skipCommentLines; +// +// this.skipCommentLines = skipCommentLines; +// +// return tmp; +// +// } +// +// public boolean getSkipCommentLines() { +// +// return skipCommentLines; +// +// } - boolean tmp = this.skipCommentLines; +// public boolean setSkipBlankLines(boolean skipBlankLines) { +// +// boolean tmp = this.skipBlankLines; +// +// this.skipBlankLines = skipBlankLines; +// +// return tmp; +// +// } +// +// public boolean getSkipBlankLines() { +// +// return skipBlankLines; +// +// } - this.skipCommentLines = skipCommentLines; +// public boolean setTrimWhitespace(boolean trimWhitespace) { +// +// boolean tmp = this.trimWhitespace; +// +// this.trimWhitespace = trimWhitespace; +// +// return tmp; +// +// } +// +// public boolean getTrimWhitespace() { +// +// return trimWhitespace; +// +// } - return tmp; - - } - - public boolean getSkipCommentLines() { - - return skipCommentLines; - - } - - public boolean setSkipBlankLines(boolean skipBlankLines) { - - boolean tmp = this.skipBlankLines; - - this.skipBlankLines = skipBlankLines; - - return tmp; - - } - - public boolean getSkipBlankLines() { - - return skipBlankLines; - - } - - public boolean setTrimWhitespace(boolean trimWhitespace) { - - boolean tmp = this.trimWhitespace; - - this.trimWhitespace = trimWhitespace; - - return tmp; - - } - - public boolean getTrimWhitespace() { - - return trimWhitespace; - - } - /** * The #of milliseconds that the {@link CSVReader} should wait before * attempting to read another line from the source (when reading from @@ -505,8 +507,7 @@ } /** - * Trim whitespace and optional quotes from each value iff - * {@link #getTrimWhitespace()} is true. + * Trim whitespace and optional quotes. * * @param cols * The column values. @@ -651,7 +652,7 @@ */ public Header[] getHeaders() { - return headers.clone(); + return ((headers==null)? null : headers.clone()); } @@ -679,7 +680,7 @@ */ public void setHeader(int index,Header header) { - if (index < 0 || index > headers.length) + if (index < 0 || index >= headers.length) throw new IndexOutOfBoundsException(); if (header == null) @@ -688,7 +689,7 @@ headers[index] = header; } - + /** * Unsupported operation. */ Deleted: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ChecksumError.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ChecksumError.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ChecksumError.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -1,46 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Nov 5, 2006 - */ - -package com.bigdata.util; - -/** - * Exception thrown when the checksum field does not match the checksum computed - * for the data being read. This is a serious error and indicates bad logic - * and/or corrupt data. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class ChecksumError extends RuntimeException { - - private static final long serialVersionUID = -9067118459184074756L; - - public ChecksumError(String msg) { - super( msg ); - } - -} \ No newline at end of file Deleted: branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ClassLoaderUtil.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ClassLoaderUtil.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/main/java/com/bigdata/util/ClassLoaderUtil.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -1,328 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -package com.bigdata.util; - -import com.bigdata.util.config.LogUtil; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import java.io.File; -import java.io.IOException; -import java.io.Serializable; - -import java.lang.reflect.Method; - -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.activation.ActivationException; -import java.rmi.activation.ActivationID; - -import java.security.SecureClassLoader; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.StringTokenizer; - -import net.jini.io.MarshalledInstance; -import net.jini.loader.ClassAnnotation; - -/** - * This class provides useful utilities for creating and manipulating - * class loaders. Although it can be used for other purposes, it is - * generally intended for debugging. - */ -public class ClassLoaderUtil { - - /** Configure logger */ - private static Logger logger = - LogUtil.getLog4jLogger(ClassLoaderUtil.class); - - // Private constructor to prevent instantiation - private ClassLoaderUtil() { } - - /** - * Utility method that converts the components of a <code>String</code> - * representing a classpath into file <code>URL</code>(s). - * - * @param classpath <code>String</code> containing components separated - * by path separators that represent the components - * making up a classpath - * - * @return a <code>URL[]</code> where - * each element of the array corresponds to one of the components - * in the <code>classpath</code> parameter. The path components - * are (potentially) expanded via - * <code>File.getCanonicalFile()</code> before converting to a - * <code>URL</code> format. - * - * @throws java.net.MalformedURLException - * If the path cannot be parsed as a URL - * @throws java.net.IOException - * If an I/O error occurs, - * which is possible because the construction of - * the canonical pathname may require filesystem queries - */ - public static URL[] getClasspathURLs(String classpath) - throws IOException, MalformedURLException - { - StringTokenizer st = new StringTokenizer(classpath,File.pathSeparator); - URL[] urls = new URL[st.countTokens()]; - for (int i=0; st.hasMoreTokens(); i++) { - urls[i] = - new File(st.nextToken()).getCanonicalFile().toURI().toURL(); - } - return urls; - } - - /** - * Utility method that converts the components of a <code>String</code> - * representing a codebase into standard <code>URL</code>(s). - * - * @param codebase <code>String</code> containing components separated - * by spaces in which each component is in - * <code>URL</code> format. - * - * @return a <code>URL[]</code> where - * each element of the array corresponds to one of the components - * in the <code>codebase</code> parameter - * - * @throws java.net.MalformedURLException - */ - public static URL[] getCodebaseURLs(String codebase) - throws MalformedURLException - { - StringTokenizer st = new StringTokenizer(codebase); - URL[] urls = new URL[st.countTokens()]; - for (int i=0; st.hasMoreTokens(); i++) { - urls[i] = new URL(st.nextToken()); - } - return urls; - } - - /** - * Utility method that converts the components of a <code>String</code> - * representing a codebase or classpath into <code>URL</code>(s). - * - * @param importCodebase <code>String</code> assumed (in order) to be - * either - * 1) a space delimited set of <code>URL</code>(s) - * representing a codebase or - * 2) a <code>File.pathSeparator</code> delimited set - * of class paths. - * - * @return a <code>URL[]</code> where - * each element of the array corresponds to one of the components - * in the <code>importCodebase</code> parameter - * - * @throws java.net.MalformedURLException - * If the path cannot be parsed as a URL - * @throws java.net.IOException - * If an I/O error occurs, - * which is possible because the construction of - * the canonical pathname may require filesystem queries - */ - public static URL[] getImportCodebaseURLs(String importCodebase) - throws IOException, MalformedURLException - { - try { - return getCodebaseURLs(importCodebase); - } catch (MalformedURLException me) { - return getClasspathURLs(importCodebase); - } - } - - /** - * Utility method that retrieves the components making up the class loader - * delegation tree for the current context class loader and returns each - * in an <code>ArrayList</code>. - * - * @return an <code>ArrayList</code> instance in which each element of the - * list is one of the components making up the current delegation - * tree. - */ - private static ArrayList getContextClassLoaderTree() { - Thread curThread = Thread.currentThread(); - ClassLoader curClassLoader = curThread.getContextClassLoader(); - return getClassLoaderTree(curClassLoader); - } - - /** - * Utility method that retrieves the components making up the class loader - * delegation tree for the given <code>classloader</code> parameter and - * returns them via an <code>ArrayList</code>. - * - * @param classloader <code>ClassLoader</code> instance whose delegation - * tree is to be retrieved and returned - * - * @return an <code>ArrayList</code> instance in which each element of the - * list is one of the components making up the delegation tree - * of the given class loader. - */ - private static ArrayList getClassLoaderTree(ClassLoader classloader) { - ArrayList loaderList = new ArrayList(); - while(classloader != null) { - loaderList.add(classloader); - classloader = classloader.getParent(); - } - loaderList.add(null); //Append boot classloader - Collections.reverse(loaderList); - return loaderList; - } - - /** - * Utility method that displays the class loader delegation tree for - * the current context class loader. For each class loader in the tree, - * this method displays the locations from which that class loader - * will retrieve and load requested classes. - * <p> - * This method can be useful when debugging problems related to the - * receipt of exceptions such as <code>ClassNotFoundException</code>. - */ - public static void displayContextClassLoaderTree() { - Thread curThread = Thread.currentThread(); - ClassLoader curClassLoader = curThread.getContextClassLoader(); - displayClassLoaderTree(curClassLoader); - } - - /** - * Utility method that displays the class loader delegation tree for - * the given class loader. For each class loader in the tree, this - * method displays the locations from which that class loader will - * retrieve and load requested classes. - * <p> - * This method can be useful when debugging problems related to the - * receipt of exceptions such as <code>ClassNotFoundException</code>. - * - * Note that although this class' logger level is used to determine - * whether or not to display any information at all, the output is - * actually displayed using System.out.println. This is done to - * produce more readable output than the logger might produce. - * - * @param description descriptive <code>String</code> that, if - * non-<code>null</code>, will be logged prior to - * displaying the information about the - * <code>classloader</code>. - * - * @param classloader <code>ClassLoader</code> instance whose delegation - * tree is to be displayed. - */ - public static void displayClassLoaderTree(ClassLoader classloader) { - displayClassLoaderTree(null, classloader); - } - - public static void displayClassLoaderTree(String description, - ClassLoader classloader) - { - if( logger.isEnabledFor(Level.DEBUG) ) { - if(description != null) { - logger.log(Level.DEBUG, description); - } - - ArrayList loaderList = getClassLoaderTree(classloader); - System.out.println("ClassLoader Tree has " - + loaderList.size() + " levels"); - System.out.println(" cl0 -- Boot ClassLoader "); - ClassLoader curClassLoader = null; - for(int i=1; i < loaderList.size(); i++) { - System.out.println(" |"); - curClassLoader = (ClassLoader)loaderList.get(i); - System.out.print(" cl"+i+" -- ClassLoader " - +curClassLoader+": "); - if(curClassLoader instanceof URLClassLoader) { - URL[] urls = ((URLClassLoader)(curClassLoader)).getURLs(); - if(urls != null) { - System.out.print(urls[0]); - for(int j=1;j<urls.length;j++){ - System.out.print(", "+urls[j]); - } - } else {//urls == null - System.out.print("null search path"); - } - } else { - if(curClassLoader instanceof SecureClassLoader) { - System.out.print("is instance of SecureClassLoader"); - } else { - System.out.print("is unknown ClassLoader type"); - } - } - System.out.println(""); - } - System.out.println(""); - } - } - - /** - * Handles a <i>class loader mismatch</i> between the given - * <code>Serializable</code> object and the given <code>Class</code> - * type. - * - * If the class name of the given <code>obj</code> parameter - * is the same as the name of <code>classType</code>, but - * <code>obj</code> is not an instance of <code>classType</code>, - * then the difference may be due to unequal class loaders for the - * two parameters; which is referred to as a <i>class loader mismatch</i>. - * When such a mismatch occurs, the <code>instanceof</code> operator - * will return <code>false</code> and attempts to cast the given - * <code>obj</code> to the given <code>classType</code> will result - * in a <code>ClassCastException</code>. - * - * To address the situation just described, this method attempts to - * "reload" the given <code>obj</code>, using the <code>ClassLoader</code> - * of <code>classType</code>. This is accomplished by first - * marshalling and then unmarshalling the given <code>obj</code>, - * while the <i>current context class loader</i> is set to the - * <code>ClassLoader</code> of <code>classType</code>. - * - * Upon success, the newly loaded object is returned; which can then - * be successfully cast to the given <code>classType</code>. If the - * reload operation fails, <code>null</code> is returned. - */ - public static Serializable instanceOf(Serializable obj, Class classType) { - - if( classType.isInstance(obj) ) return obj; - - Class objClass = obj.getClass(); - ClassLoader classTypeCl = classType.getClassLoader(); - //marshall-and-unmarshal using the class type's classloader - try { - MarshalledInstance mInst = new MarshalledInstance(obj); - Serializable newObj = - (Serializable)(mInst.get(classTypeCl, false, null, null)); - if( classType.isInstance(newObj) ) return newObj; - - } catch(Throwable t) { - return null; - } - return null; - } - -} Added: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/CSVReaderBuilder.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/CSVReaderBuilder.java (rev 0) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/CSVReaderBuilder.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -0,0 +1,204 @@ +package com.bigdata.util; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +public class CSVReaderBuilder { + /** <code>List</code> holding the header row, if any. */ + private final List<String> header = new ArrayList<String>(); + /** <code>List</code> of <code>List</code>s holding the columnar data */ + private final List<List<String>>rows = new ArrayList<List<String>>(); + /** <code>List</code> holding the current row being operated on. */ + private final List<String> currentRow = new ArrayList<String>(); + /** Flag determining whether or not to display the header row. Default is false. */ + private boolean suppressHeader = false; + /** Flag determining whether or not to display quoted content. Default is false. */ + private boolean suppressQoutes = false; + /** <code>String</code> used for column delimiter. Default is a comma. */ + private String columnDelimiter = ","; + /** <code>String</code> used for row delimiter. Default is a newline. */ + private String rowDelimter = "\n"; + /** <code>String</code> used for quote delimiter. Default is a double quote. */ + private String quoteDelimter = "\""; + + //Setters and getters + public String getQuoteDelimter() { + return quoteDelimter; + } + public void setQuoteDelimter(String quoteDelimter) { + this.quoteDelimter = quoteDelimter; + } + public boolean isSuppressQoutes() { + return suppressQoutes; + } + public void setSuppressQoutes(boolean suppressQoutes) { + this.suppressQoutes = suppressQoutes; + } + public String getColumnDelimiter() { + return columnDelimiter; + } + public void setColumnDelimiter(String columnDelimiter) { + this.columnDelimiter = columnDelimiter; + } + public String getRowDelimiter() { + return rowDelimter; + } + public void setRowDelimiter(String rowDelimter) { + this.rowDelimter = rowDelimter; + } + public boolean isSuppressHeader() { + return suppressHeader; + } + public void setSuppressHeader(boolean suppressHeader) { + this.suppressHeader = suppressHeader; + } + + /** Default constructor */ + CSVReaderBuilder() {} + + /** Adds the given string to the header row */ + public CSVReaderBuilder header(String h){header.add(h); return this;} + + /** Adds the given string to the current row */ + public CSVReaderBuilder column(String c){currentRow.add(c); return this;} + + /** Creates a new row by: 1) flushing the current row data, if any, to the collection + * of row data and 2) clearing the the current row. + */ + public CSVReaderBuilder newRow() { + flushCurrentRow(); + currentRow.clear(); + return this; + } + + /** + * Helper method for flushing and clearing the current row. + */ + private void flushCurrentRow() { + if (!currentRow.isEmpty()) { + List<String> t = new ArrayList<String>(); + for (String s: currentRow) { + t.add(s); + } + rows.add(t); + } + currentRow.clear(); + } + + /** + * Creates and returns a <code>Reader</code> object which contains the current set + * of header (optional) and data rows. The data will be formatted according to the + * current set of configurable attributes (e.g. delimiter settings). + * @return Reader which contains the formatted header and data rows. + */ + public Reader buildReader() { + StringBuilder sb = new StringBuilder(); + if (!suppressHeader) { + addHeader(sb); + } + flushCurrentRow(); + addRows(sb); + return new StringReader(sb.toString()); + } + + /** + * Helper method for adding (optional) header data to given <code>StringBuilder</code>. + * @param sb <code>StringBuilder</code> to append header row. + */ + private void addHeader(StringBuilder sb) { + sb.append(join(header)); + sb.append(getRowDelimiter()); + } + + /** + * Helper methos for adding data rows to the given <code>StringBuilder</code>. + * @param sb <code>StringBuilder</code> to append data rows. + */ + private void addRows(StringBuilder sb) { + for (List<String> row: rows) { + sb.append(join(row)); + sb.append(getRowDelimiter()); + } + } + + /** + * Helper method that optionally adds the configured quote delimiter to the given + * <code>String</code>. + * @param h The <code>String</code> to optionally quote. + * @return The optionally quoted <code>String</code> + */ + private String quote(String h) { + String quoted = h; + if (!suppressQoutes) { + quoted = getQuoteDelimter() + h + getQuoteDelimter(); + } + return quoted; + } + + /** + * Helper method that joins the given collection of <code>String</code> using the + * configured column delimiter. + * @param s the collection of strings to join + * @return String containing the collection's elements separated by the column delimiter. + */ + public String join(Collection<String> s) { + if (s == null || s.isEmpty()) return ""; + Iterator<String> iter = s.iterator(); + StringBuilder builder = new StringBuilder(quote(iter.next())); + while( iter.hasNext() ) + { + builder.append(getColumnDelimiter()).append(quote(iter.next())); + } + return builder.toString(); + } + + /** + * Test driver method for this class. [Not exhaustive.] + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + CSVReaderBuilder cb = new CSVReaderBuilder(); + cb.header("A").header("B").header("C"); + cb.newRow().column("a").column("b").column("c"); + cb.newRow().column("x").column("y").column("z"); + cb.newRow().column(""); + cb.newRow().column("#"); + Reader r = cb.buildReader(); + System.out.println("Default listing..."); + listReader(r); + cb.setSuppressQoutes(true); + r = cb.buildReader(); + System.out.println("No quotes listing..."); + listReader(r); + cb.setSuppressHeader(true); + r = cb.buildReader(); + System.out.println("No quotes and no header listing..."); + listReader(r); + cb.setColumnDelimiter("\t"); + r = cb.buildReader(); + System.out.println("No quotes and no header and tab delimited listing..."); + listReader(r); + } + + /** + * Helper method for displaying content of the given <code>Reader</code> + * to <code>System.out</code>. + * @param r the <code>Reader</code> to read from. + * @throws IOException if there's a problem obtaining data from the <code>Reader</code>. + */ + private static void listReader(Reader r) throws IOException { + BufferedReader br = new BufferedReader(r); + String s = null; + while((s = br.readLine()) != null) { + System.out.println(s); + } + } +} + Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestAll.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -73,8 +73,6 @@ // Note: class is not debugged and is marked as deprecated, test is commented out. // suite.addTestSuite( TestHybridTimestampFactory.class ); - suite.addTestSuite(TestByteBufferBitVector.class); - suite.addTestSuite( TestCSVReader.class ); suite.addTestSuite( TestBootStateUtil.class ); return suite; Deleted: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestByteBufferBitVector.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestByteBufferBitVector.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestByteBufferBitVector.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -1,197 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created on Aug 6, 2009 - */ - -package com.bigdata.util; - -import it.unimi.dsi.bits.BitVector; - -import java.nio.ByteBuffer; - -import com.bigdata.util.ByteBufferBitVector; - -import junit.framework.TestCase2; - -/** - * Test suite for {@link ByteBufferBitVector}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ -public class TestByteBufferBitVector extends TestCase2 { - - /** - * - */ - public TestByteBufferBitVector() { - } - - /** - * @param name - */ - public TestByteBufferBitVector(String name) { - super(name); - } - - /** Correct rejection test for ctor1. */ - public void test_ctor1_correct_rejection() { - - try { - new ByteBufferBitVector(null); - fail("Expecting: " + IllegalArgumentException.class); - } catch (IllegalArgumentException ex) { - if (log.isInfoEnabled()) - log.info("ignoring expected exception: " + ex); - } - - } - - public void test_ctor1() { - - final byte[] d = new byte[1]; - final ByteBuffer b = ByteBuffer.wrap(d); - final BitVector v = new ByteBufferBitVector(b); - - assertEquals("length", 8L, v.length()); - - // verify range check. - try { - v.getBoolean(-1); - fail("Expecting: " + IndexOutOfBoundsException.class); - } catch (IndexOutOfBoundsException ex) { - if (log.isInfoEnabled()) - log.info("Ignoring expected exception: " + ex); - } - - // verify range check. - try { - v.getBoolean(8); - fail("Expecting: " + IndexOutOfBoundsException.class); - } catch (IndexOutOfBoundsException ex) { - if (log.isInfoEnabled()) - log.info("Ignoring expected exception: " + ex); - } - - for (long i = 0; i < 8L; i++) - assertEquals(false, v.getBoolean(i)); - - // set bit zero. - d[0] |= (1 << 0); - if (log.isInfoEnabled()) - log.info(v.toString()); - assertEquals(true, v.getBoolean(0)); - - // clear bit zero. - d[0] &= ~(1 << 0); - if (log.isInfoEnabled()) - log.info(v.toString()); - assertEquals(false, v.getBoolean(0)); - - } - - /** - * Correct rejection and assumptions for ctor accepting offset and length - * options. - * - * @todo this tests with an even byte offset. Try w/ only a few bits offset. - */ - public void test_ctor2() { - - final byte[] d = new byte[3]; - final ByteBuffer b = ByteBuffer.wrap(d); - final BitVector v = new ByteBufferBitVector(b, 8, 8); - - assertEquals("length", 8L, v.length()); - - // verify range check. - try { - v.getBoolean(-1); - fail("Expecting: " + IndexOutOfBoundsException.class); - } catch (IndexOutOfBoundsException ex) { - if (log.isInfoEnabled()) - log.info("Ignoring expected exception: " + ex); - } - - // verify range check. - try { - v.getBoolean(8); - fail("Expecting: " + IndexOutOfBoundsException.class); - } catch (IndexOutOfBoundsException ex) { - if (log.isInfoEnabled()) - log.info("Ignoring expected exception: " + ex); - } - - for (long i = 0; i < 8L; i++) - assertEquals(false, v.getBoolean(i)); - - // set bit zero. - d[1] |= (1 << 0); - if (log.isInfoEnabled()) - log.info(v.toString()); - assertEquals(true, v.getBoolean(0)); - - // clear bit zero. - d[1] &= ~(1 << 0); - if (log.isInfoEnabled()) - log.info(v.toString()); - assertEquals(false, v.getBoolean(0)); - - } - - /** - * Verify set/clear of each bit in the first byte. - */ - public void test_getBoolean() { - - final byte[] d = new byte[1]; - final ByteBuffer b = ByteBuffer.wrap(d); - final BitVector v = new ByteBufferBitVector(b); - - // verify all bits are zero. - for (long i = 0; i < 8L; i++) - assertEquals(false, v.getBoolean(i)); - - // set/clear each bit in the first byte in turn. - for (int i = 0; i < 8; i++) { - - // set bit - d[0] |= (1 << i); - if (log.isInfoEnabled()) - log.info(v.toString() + " : i=" + i + ", (1<<" + i + ")=" - + (i << i)); - assertEquals(true, v.getBoolean(i)); - - // clear bit - d[0] &= ~(1 << i); - if (log.isInfoEnabled()) - log.info(v.toString()); - assertEquals(false, v.getBoolean(i)); - - } - - } - -} Modified: branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestCSVReader.java =================================================================== --- branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestCSVReader.java 2010-09-24 17:46:05 UTC (rev 3627) +++ branches/bbb_cleanup/bigdata-core/src/test/java/com/bigdata/util/TestCSVReader.java 2010-09-24 18:26:07 UTC (rev 3628) @@ -29,10 +29,20 @@ import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.io.StringReader; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; import java.util.Iterator; +import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import java.util.TreeMap; import junit.framework.TestCase2; @@ -64,23 +74,41 @@ super(name); } - public void test_ctor_correctRejection() throws IOException { + public void test_ctor1_correctRejection() + throws IOException, SecurityException, NoSuchMethodException, + InstantiationException, IllegalAccessException, InvocationTargetException + { + Object[][] cmdLines = { + new Object[] {null, null}, + new Object[] {null, "UTF-8"}, + new Object[] {new ByteArrayInputStream(new byte[]{}), null}, + }; - try { - new CSVReader(null,"UTF-8"); - fail("Expecting: "+IllegalArgumentException.class); - } catch(IllegalArgumentException ex) { - log.info("Ignoring expected exception: "+ex); + Constructor<CSVReader> cons = + CSVReader.class.getConstructor(InputStream.class, String.class); + for (Object[] cmdLine: cmdLines) { + try { + cons.newInstance(cmdLine); + fail("Expecting: " + IllegalArgumentException.class.toString()); + } catch(InvocationTargetException ex) { + if (!(ex.getCause() instanceof IllegalArgumentException)) { + fail("Expecting: " + IllegalArgumentException.class.toString()); + } + //ignore -- expected + } } + } + + public void test_ctor2_correctRejection() throws IOException { try { - new CSVReader(new ByteArrayInputStream(new byte[]{}),null); - fail("Expecting: "+IllegalArgumentException.class); + Reader r = null; + new CSVReader(r); + fail("Expecting: " + IllegalArgumentException.class.toString()); } catch(IllegalArgumentException ex) { - log.info("Ignoring expected exception: "+ex); + //ignore -- expected } - - } + } /** * Test reads from a tab-delimited file <code>test.csv</code> with headers @@ -113,7 +141,7 @@ assertEquals(1,r.lineNo()); - assertEquals(headers, r.headers); + assertEquals(headers, r.getHeaders()); /* * 1st row of data. @@ -206,7 +234,359 @@ assertFalse(r.hasNext()); } + + private static Header[] convertStringToHeader(String[] sa) { + Header[] h = new Header[sa.length]; + int i=0; + for (String s: sa) { + h[i++] = new Header(s); + } + return h; + } + private static String[] stringHeaders = { "Header1", "Header2", "Header3" }; + private static String[] defaultStringHeaders = { "1", "2", "3" }; + + private static Header[] headers = convertStringToHeader(stringHeaders); + private static Header[] defaultHeaders = convertStringToHeader(defaultStringHeaders); + + private static Object[][] rows = { + { "Column11", "Column12", "Column13" }, + { "Column21", "Column22", "Column23" }, + { "Column31", "Column32", "Column33" }, + { "Column with spaces", "and more spaces", "and embedded \"quotes\"" }, + }; + + private static CSVReaderBuilder getDefaultTestCSVReaderBuilder() { + CSVReaderBuilder b = new CSVReaderBuilder(); + for (String header: stringHeaders) { + b.header(header); + } + for (Object[] row: rows) { + b.newRow(); + for (Object col: row) { + b.column(col.toString()); + } + } + return b; + } + + public void test_default_csv_reader_with_defaults() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + verify_data_and_header(new CSVReader(cb.buildReader())); + } + public void test_default_csv_reader_with_tabs() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + cb.setColumnDelimiter("\t"); + verify_data_and_header(new CSVReader(cb.buildReader())); + } + public void test_default_csv_reader_without_quotes() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + cb.setSuppressQoutes(true); + verify_data_and_header(new CSVReader(cb.buildReader())); + } + public void test_default_csv_reader_no_headers() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + cb.setSuppressHeader(true); + verify_data(new CSVReader(cb.buildReader()),defaultHeaders); + } + + private void verify_data_and_header(CSVReader cr) throws IOException { + // Read and verify header row + assertTrue(cr.hasNext()); + cr.readHeaders(); + assertEquals(cr.getHeaders(), headers); + verify_data(cr, headers); + } + + private void verify_data(CSVReader cr, Header[] headers) throws IOException { + //Read and verify data rows + for (int i=0; i < rows.length; i++) { + assertTrue(cr.hasNext()); + assertSameValues( newMap(headers, rows[i]), cr.next() ); + } + assertFalse(cr.hasNext()); + } + + public void test_header_cons_with_bad_args() { + try { + new Header(null); + fail("Constructed Header with null arg."); + } catch (IllegalArgumentException e){ + //ignore -- expected + } + try { + new Header(""); + fail("Constructed Header with empty arg."); + } catch (IllegalArgumentException e){ + //ignore -- expected + } + } + + public void test_header_cons_with_good_arg() { + String name = "abc"; + Header h = new Header(name); + assertEquals(h.getName(), name); + } + + public void test_header_equals() { + String name = "abc"; + Header h = new Header(name); + Header h_dup = new Header(name); + Header h_dup2 = new Header(name); + Header h_diff = new Header(name + "diff"); + + // Test reflexive property + assertTrue(h.equals(h)); + + // Test symmetric property + assertTrue(h.equals(h_dup) && h_dup.equals(h)); + + //Test transitive property + assertTrue(h.equals(h_dup) && h_dup.equals(h_dup2) && h.equals(h_dup2)); + + // consistency property already tested + + // Test negative cases + assertFalse(h.equals(null)); + + assertFalse(h.equals(name)); + + assertFalse(h.equals(h_diff)); + } + + public void test_header_hashcode() { + String name = "abc"; + Header h = new Header(name); + Header h_dup = new Header(name); + + assertTrue(h.hashCode()==h_dup.hashCode()); + } + + public void test_header_toString() { + String name = "abc"; + Header h = new Header(name); + Header h_dup = new Header(name); + + assertTrue(h.toString().equals(name)); + } + + public void test_setTailDelayMillis_bad_arg() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + CSVReader r = new CSVReader(cb.buildReader()); + try { + r.setTailDelayMillis(-1L); + fail("Created CSVReader with negative delay."); + } catch (IllegalArgumentException e) { + //ignore -- expected + } + } + + public void test_setTailDelayMillis_good_arg() throws IOException { + CSVReaderBuilder cb = getDefaultTestCSVReaderBuilder(); + CSVReader r = new CSVReader(cb.buildReader()); + long delay = 1L; + long oldDelay = 0L; + long tmpDelay = 0L; + tmpDelay = r.setTailDelayMillis(delay); + assertTrue(r.getTailDelayMillis()==delay); + assertTrue(tmpDelay==oldDelay); + } + + private static class DelayedReader extends StringReader { + + private boolean isReady = false; + private int maxDelayCount = 3; + private int delayCount = 1; + + public DelayedReader(String s) { + super(s); + } + + @Override + public boolean ready() { + if (delayCount++ > maxDelayCount) isReady = true; + return isReady; + } + + } + + public void test_delay_with_reader() throws IOException { + CSVReaderBuilder crb = new CSVReaderBuilder(); + StringReader s = + new DelayedReader( + crb.join(Arrays.asList(stringHeaders))); + CSVReader r = new CSVReader(s); + r.setTailDelayMillis(1000); // 1 sec + assertTrue(r.hasNext()); + r.readHeaders(); + Header[] actualHeaders = r.getHeaders(); + Header[] expectedHeaders = headers; + assertEquals(expectedHeaders, actualHeaders); + } + + public void test_delay_with_reader_with_comments_and_empty_lines() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + crb.header("H1").header("H2").header("H3"); + crb.newRow().column("c1").column("c2").column("c3"); + crb.newRow().column("# Comment line"); + crb.newRow().column(""); //Blank line + crb.newRow().column("d1").column("d2").column("d3"); + crb.setSuppressQoutes(true); // Otherwise # isn't first char + CSVReader r = new CSVReader(crb.buildReader()); + assertTrue(r.hasNext()); + r.readHeaders(); + Header[] actualHeaders = r.getHeaders(); + Header[] expectedHeaders = new Header[] { + new Header("H1"), + new Header("H2"), + new Header("H3"), + }; + assertEquals(expectedHeaders, actualHeaders); + //Check that two rows of data gets returned + Map<String, Object> actualRow = r.next(); + Map<String, Object> expectedRow = + newMap(expectedHeaders, + new Object[] { "c1", "c2", "c3"} ); + assertSameValues(expectedRow, actualRow); + actualRow = r.next(); + expectedRow = + newMap(expectedHeaders, + new Object[] { "d1", "d2", "d3"} ); + assertSameValues(expectedRow, actualRow); + assertFalse(r.hasNext()); + try { + r.next(); + fail("Successfully called next() on an empty reader."); + } catch (NoSuchElementException e) { + //ignore -- expected + } + } + + public void test_get_headers() + throws IOException + { + CSVReader r = new CSVReader(new StringReader("")); + assertNull(r.getHeaders()); + } + + public void test_get_headers2() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + r.readHeaders(); + Header[] actual = r.getHeaders(); + assertEquals(headers, actual); + } + + public void test_set_headers_null() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + try { + r.setHeaders(null); + fail("Was able to set null headers."); + } catch (IllegalArgumentException e) { + //ignore -- expected + } + } + + public void test_set_headers() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + r.readHeaders(); + Header[] actual = r.getHeaders(); + assertEquals(headers, actual); + r.setHeaders(defaultHeaders); + actual = r.getHeaders(); + assertEquals(defaultHeaders, actual); + + } + + public void test_set_header_out_of_bounds() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + r.readHeaders(); + Header[] actual = r.getHeaders(); + assertEquals(headers, actual); + try { + r.setHeader(stringHeaders.length, new Header("out-of-bounds")); + fail("Able to set an out-of-bounds header element."); + } catch (IndexOutOfBoundsException e) { + //ignore -- expected + } + } + public void test_set_header_null() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + r.readHeaders(); + Header[] actual = r.getHeaders(); + assertEquals(headers, actual); + try { + r.setHeader(stringHeaders.length-1, null); + fail("Able to set a null header element."); + } catch (IllegalArgumentException e) { + //ignore -- expected + } + } + + public void test_set_header_valid() + throws IOException + { + CSVReaderBuilder crb = new CSVReaderBuilder(); + CSVReader r = + new CSVReader( + new StringReader( + crb.join(Arrays.asList(stringHeaders)))); + r.readHeaders(); + Header[] actual = r.getHeaders(); + assertEquals(headers, actual); + Header[] headersClone = headers.clone(); + int last = headersClone.length-1; + headersClone[last] = new Header("replacement"); + r.setHeader(last, headersClone[last]); + actual = r.getHeaders(); + assertEquals(headersClone, actual); + } + + public void test_remove() + throws IOException + { + CSVReader r = + new CSVReader(new StringReader("bogus")); + try { + r.remove(); + fail("Successfully called unsupported operation."); + } catch (UnsupportedOperationException e) { + // ignore -- expected + } + } + protected void assertEquals(Header[] expected, Header[] actual) { assertEquals(expected.length,actual.length); @@ -215,7 +595,7 @@ if(!expected[i].equals( actual[i])) { - fail("headers["+i+"], expected ["+expected[i]+"]u not ["+actual[i]+"]" ); + fail("headers["+i+"], expected ["+expected[i]+"] not ["+actual[i]+"]" ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgo...@us...> - 2010-09-24 17:46:12
|
Revision: 3627 http://bigdata.svn.sourceforge.net/bigdata/?rev=3627&view=rev Author: sgossard Date: 2010-09-24 17:46:05 +0000 (Fri, 24 Sep 2010) Log Message: ----------- [maven_scaleout] : Fix for broken IndexSegment caused by r3612, which did not account for IndexSegment btrees being constructed by reflection. IndexSegment now properly returns SegmentMetadata, and this is verified in unit tests. This change also introduces a common super-type for IJournal and IndexSegmentStore, the new IStoreFile interface. Modified Paths: -------------- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/BTree.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/Journal.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/service/jini/util/DumpFederation.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestAll_IndexSegment.java Added Paths: ----------- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/AbstractBTree.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -1335,7 +1335,7 @@ */ abstract public IRawStore getStore(); - final public IResourceMetadata[] getResourceMetadata() { + public IResourceMetadata[] getResourceMetadata() { if (store == null) { @@ -1351,14 +1351,12 @@ }; + } else { + //This is a default metadata, appropriate for rawstores. + return new IResourceMetadata[] { + new SimpleResourceMetadata(store.getUUID()) + }; } - - return new IResourceMetadata[] { - - new SimpleResourceMetadata(store.getUUID()) - - }; - } /** Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/BTree.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/BTree.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/BTree.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -190,6 +190,11 @@ } + public final IResourceMetadata[] getResourceMetadata() { + //override to make final so sub-classes cannot modify behavior. + return super.getResourceMetadata(); + } + /** * Returns an {@link ICounter}. The {@link ICounter} is mutable iff the * {@link BTree} is mutable. All {@link ICounter}s returned by this method Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegment.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -34,6 +34,7 @@ import com.bigdata.btree.raba.ReadOnlyValuesRaba; import com.bigdata.io.AbstractFixedByteArrayBuffer; import com.bigdata.io.FixedByteArrayBuffer; +import com.bigdata.mdi.IResourceMetadata; import com.bigdata.service.Event; import com.bigdata.service.EventResource; import com.bigdata.service.EventType; @@ -676,6 +677,13 @@ } + public final IResourceMetadata[] getResourceMetadata() { + //Overrides the default returned metadata, providing IndexSegmentStore specific metadata. + return new IResourceMetadata[] { + fileStore.getResourceMetadata() + }; + } + /* * INodeFactory */ Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/btree/IndexSegmentStore.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -37,10 +37,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; +import com.bigdata.journal.IStoreFile; import org.apache.log4j.Logger; import com.bigdata.cache.IGlobalLRU; -import com.bigdata.cache.IGlobalLRU.ILRUCache; import com.bigdata.counters.CounterSet; import com.bigdata.counters.Instrument; import com.bigdata.counters.OneShotInstrument; @@ -67,7 +67,7 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public class IndexSegmentStore extends AbstractRawStore { +public class IndexSegmentStore extends AbstractRawStore implements IStoreFile { /** * Logger. Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IJournal.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -25,8 +25,6 @@ import java.util.Properties; -import com.bigdata.btree.keys.IKeyBuilderFactory; -import com.bigdata.mdi.IResourceMetadata; import com.bigdata.rawstore.IMRMW; /** @@ -39,7 +37,7 @@ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ -public interface IJournal extends IMRMW, IAtomicStore, IBTreeManager { +public interface IJournal extends IMRMW, IAtomicStore, IBTreeManager, IStoreFile { /** * A copy of the properties used to initialize this journal. @@ -56,9 +54,5 @@ * Immediate shutdown. */ public void shutdownNow(); - - /** - * A description of this store in support of the scale-out architecture. - */ - public IResourceMetadata getResourceMetadata(); + } Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IResourceManager.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -40,7 +40,6 @@ import com.bigdata.btree.IndexSegmentStore; import com.bigdata.btree.view.FusedView; import com.bigdata.counters.CounterSet; -import com.bigdata.rawstore.IRawStore; import com.bigdata.resources.ResourceManager; import com.bigdata.resources.StaleLocatorException; import com.bigdata.resources.StaleLocatorReason; @@ -99,17 +98,17 @@ public AbstractJournal getJournal(long timestamp); /** - * Opens an {@link IRawStore}. + * Opens an {@link IStoreFile}. * * @param uuid * The UUID identifying that store file. * - * @return The open {@link IRawStore}. + * @return The open {@link IStoreFile}. * * @throws RuntimeException * if something goes wrong. */ - public IRawStore openStore(UUID uuid); + public IStoreFile openStore(UUID uuid); /** * Return the ordered {@link AbstractBTree} sources for an index or a view Added: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java (rev 0) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -0,0 +1,53 @@ +/* + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +package com.bigdata.journal; + +import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.rawstore.IRawStore; + +import com.bigdata.btree.IndexSegmentStore; +import com.bigdata.journal.IJournal; + +/** + * An {@link IRawStore} that exposes additional serializable metadata allowing it to be managed by an + * {@link IResourceManager}. Currently this is common interface between the two main store + * file types that are used to store btree indices. + * <b /> + * The methods on this interface have been moved from <code>IRawStore</code> in order to reduce the burden on + * rawstore implementations which we often needed to stub methods out even though they were never used. + * It also improves encapsulation by removing direct knowledge of resource management related classes in the rawstore + * package. + * + * {@see IndexSegmentStore} + * {@see IJournal} + */ +public interface IStoreFile extends IRawStore { + + /** + * A description of this store in support of the scale-out architecture. + */ + public IResourceMetadata getResourceMetadata(); +} Property changes on: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/IStoreFile.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/Journal.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/Journal.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/journal/Journal.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -49,7 +49,6 @@ import com.bigdata.config.IntegerValidator; import com.bigdata.config.LongValidator; import com.bigdata.counters.CounterSet; -import com.bigdata.rawstore.IRawStore; import com.bigdata.relation.locator.DefaultResourceLocator; import com.bigdata.relation.locator.ILocatableResource; import com.bigdata.relation.locator.IResourceLocator; @@ -292,7 +291,7 @@ * Note: This will only succeed if the <i>uuid</i> identifies <i>this</i> * journal. */ - public IRawStore openStore(final UUID uuid) { + public IStoreFile openStore(final UUID uuid) { if(uuid == getRootBlockView().getUUID()) { Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/IndexManager.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -42,6 +42,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Lock; +import com.bigdata.journal.*; import org.apache.log4j.Logger; import com.bigdata.btree.AbstractBTree; @@ -66,24 +67,12 @@ import com.bigdata.counters.CounterSet; import com.bigdata.counters.ICounterSet; import com.bigdata.io.DataInputBuffer; -import com.bigdata.journal.AbstractJournal; -import com.bigdata.journal.AbstractTask; -import com.bigdata.journal.ConcurrencyManager; -import com.bigdata.journal.ICommitRecord; -import com.bigdata.journal.IJournal; -import com.bigdata.journal.ITx; -import com.bigdata.journal.Journal; -import com.bigdata.journal.Name2Addr; -import com.bigdata.journal.NoSuchIndexException; -import com.bigdata.journal.TimestampUtility; -import com.bigdata.journal.Tx; import com.bigdata.journal.Name2Addr.Entry; import com.bigdata.journal.Name2Addr.EntrySerializer; import com.bigdata.mdi.IResourceMetadata; import com.bigdata.mdi.LocalPartitionMetadata; import com.bigdata.mdi.SegmentMetadata; import com.bigdata.rawstore.Bytes; -import com.bigdata.rawstore.IRawStore; import com.bigdata.service.Event; import com.bigdata.service.EventType; import com.bigdata.service.IBigdataClient; @@ -134,11 +123,11 @@ * Note: The {@link IIndex}s managed by this class are a * {@link FusedView} of {@link AbstractBTree}s. Each * {@link AbstractBTree} has a hard reference to the backing - * {@link IRawStore} and will keep the {@link IRawStore} from being + * {@link com.bigdata.journal.IStoreFile} and will keep the {@link IStoreFile} from being * finalized as long as a hard reference exists to the - * {@link AbstractBTree} (the reverse is not true - an {@link IRawStore} + * {@link AbstractBTree} (the reverse is not true - an {@link IStoreFile} * reference does NOT hold a hard reference to {@link AbstractBTree}s - * on that {@link IRawStore}). + * on that {@link IStoreFile}). * <p> * Note: The retention of the {@link BTree}s on the live * {@link ManagedJournal}s is governed by @@ -923,7 +912,7 @@ * {@link StoreManager#openStores}. */ public AbstractBTree getIndexOnStore(final String name, - final long timestamp, final IRawStore store) { + final long timestamp, final IStoreFile store) { if (name == null) throw new IllegalArgumentException(); @@ -1232,7 +1221,7 @@ final IResourceMetadata resource = a[i]; - final IRawStore store; + final IStoreFile store; try { store = openStore(resource.getUUID()); @@ -2021,7 +2010,7 @@ /** * Canonical per-index partition {@link BTreeCounters}. These counters are * set on each {@link AbstractBTree} that is materialized by - * {@link #getIndexOnStore(String, long, IRawStore)}. The same + * {@link #getIndexOnStore(String, long, IStoreFile)}. The same * {@link BTreeCounters} object is used for the unisolated, read-committed, * read-historical and isolated views of the index partition and for each * source in the view regardless of whether the source is a mutable Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/resources/StoreManager.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -44,13 +44,13 @@ import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import com.bigdata.journal.*; import org.apache.log4j.Logger; import com.bigdata.bfs.BigdataFileSystem; @@ -67,25 +67,7 @@ import com.bigdata.cache.IGlobalLRU.ILRUCache; import com.bigdata.concurrent.NamedLock; import com.bigdata.io.SerializerUtil; -import com.bigdata.journal.AbstractJournal; -import com.bigdata.journal.AbstractLocalTransactionManager; -import com.bigdata.journal.BufferMode; -import com.bigdata.journal.CommitRecordIndex; -import com.bigdata.journal.ConcurrencyManager; -import com.bigdata.journal.DiskOnlyStrategy; -import com.bigdata.journal.IBufferStrategy; -import com.bigdata.journal.ICommitRecord; -import com.bigdata.journal.IConcurrencyManager; -import com.bigdata.journal.ILocalTransactionManager; -import com.bigdata.journal.IResourceLockService; -import com.bigdata.journal.IResourceManager; -import com.bigdata.journal.IRootBlockView; //BTM import com.bigdata.journal.ITransactionService; -import com.bigdata.journal.ITx; -import com.bigdata.journal.Name2Addr; -import com.bigdata.journal.TemporaryStore; -import com.bigdata.journal.WORMStrategy; -import com.bigdata.journal.WriteExecutorService; import com.bigdata.journal.WORMStrategy.StoreCounters; import com.bigdata.mdi.IPartitionMetadata; import com.bigdata.mdi.IResourceMetadata; @@ -94,7 +76,6 @@ import com.bigdata.mdi.LocalPartitionMetadata; import com.bigdata.mdi.SegmentMetadata; import com.bigdata.rawstore.Bytes; -import com.bigdata.rawstore.IRawStore; import com.bigdata.relation.locator.DefaultResourceLocator; import com.bigdata.service.DataService; import com.bigdata.service.Event; @@ -108,8 +89,8 @@ import static java.util.concurrent.TimeUnit.*; //BTM -import com.bigdata.journal.TransactionService; + /** * Class encapsulates logic for managing the store files (journals and index * segments), including the logic to compute the effective release time for the @@ -178,7 +159,7 @@ String DATA_DIR = StoreManager.class.getName()+".dataDir"; /** - * The capacity of the LRU cache of open {@link IRawStore}s. The + * The capacity of the LRU cache of open {@link IStoreFile}s. The * capacity of this cache indirectly controls how many stores will be * held open. The main reason for keeping an store open is to reuse its * buffers if another request arrives "soon" which would read on that @@ -213,7 +194,7 @@ * The time in milliseconds before an entry in the store cache will be * cleared from the backing {@link HardReferenceQueue} (default * {@value #DEFAULT_STORE_CACHE_TIMEOUT}). This property controls how - * long the store cache will retain an {@link IRawStore} which has not + * long the store cache will retain an {@link IStoreFile} which has not * been recently used. This is in contrast to the cache capacity. */ String STORE_CACHE_TIMEOUT = StoreManager.class.getName() @@ -574,8 +555,8 @@ * @see Options#STORE_CACHE_CAPACITY * @see Options#STORE_CACHE_TIMEOUT */ -// final protected WeakValueCache<UUID, IRawStore> storeCache; - final protected ConcurrentWeakValueCacheWithTimeout<UUID, IRawStore> storeCache; +// final protected WeakValueCache<UUID, IStoreFile> storeCache; + final protected ConcurrentWeakValueCacheWithTimeout<UUID, IStoreFile> storeCache; /** * Provides locks on a per-{resourceUUID} basis for higher concurrency. @@ -583,11 +564,11 @@ private final transient NamedLock<UUID> namedLock = new NamedLock<UUID>(); /** - * The #of entries in the hard reference cache for {@link IRawStore}s, + * The #of entries in the hard reference cache for {@link IStoreFile}s, * including both {@link ManagedJournal}s and IndexSegment}s. There MAY be - * more {@link IRawStore}s open than are reported by this method if there - * are hard references held by the application to those {@link IRawStore}s. - * {@link IRawStore}s that are not fixed by a hard reference will be + * more {@link IStoreFile}s open than are reported by this method if there + * are hard references held by the application to those {@link IStoreFile}s. + * {@link IStoreFile}s that are not fixed by a hard reference will be * quickly finalized by the JVM. */ public int getStoreCacheSize() { @@ -1123,12 +1104,12 @@ throw new RuntimeException(Options.STORE_CACHE_TIMEOUT + " must be non-negative"); - storeCache = new ConcurrentWeakValueCacheWithTimeout<UUID, IRawStore>( + storeCache = new ConcurrentWeakValueCacheWithTimeout<UUID, IStoreFile>( storeCacheCapacity, MILLISECONDS .toNanos(storeCacheTimeout)); -// storeCache = new WeakValueCache<UUID, IRawStore>( -// new LRUCache<UUID, IRawStore>(storeCacheCapacity)); +// storeCache = new WeakValueCache<UUID, IStoreFile>( +// new LRUCache<UUID, IStoreFile>(storeCacheCapacity)); } @@ -2036,7 +2017,7 @@ * that we can find the relevant journal quickly for a given timestamp. * <p> * Note: This requires that we open each resource in order to extract its - * {@link IResourceMetadata} description. We only open the {@link IRawStore} + * {@link IResourceMetadata} description. We only open the {@link IStoreFile} * for the resource, not its indices. The stores are closed again * immediately. * @@ -2249,15 +2230,15 @@ */ private void closeStores() { -// final Iterator<IRawStore> itr = storeCache.iterator(); +// final Iterator<IStoreFile> itr = storeCache.iterator(); - final Iterator<WeakReference<IRawStore>> itr = storeCache.iterator(); + final Iterator<WeakReference<IStoreFile>> itr = storeCache.iterator(); while (itr.hasNext()) { -// final IRawStore store = itr.next(); +// final IStoreFile store = itr.next(); - final IRawStore store = itr.next().get(); + final IStoreFile store = itr.next().get(); if (store == null) { // weak reference has been cleared. @@ -2804,12 +2785,12 @@ } /** - * Opens an {@link IRawStore}. + * Opens an {@link IStoreFile}. * * @param uuid * The UUID identifying that store file. * - * @return The open {@link IRawStore}. + * @return The open {@link IStoreFile}. * * @throws IllegalStateException * if the {@link StoreManager} is not open. @@ -2830,7 +2811,7 @@ * something goes wrong (except that I was planning to drop the file * name from that interface). */ - public IRawStore openStore(final UUID uuid) { + public IStoreFile openStore(final UUID uuid) { assertRunning(); @@ -2854,7 +2835,7 @@ * Check to see if the given resource is already open. */ - IRawStore store; + IStoreFile store; // synchronized(storeCache) { store = storeCache.get(uuid); @@ -3311,9 +3292,9 @@ // if(false) {// @todo remove code. // int nstores = 0, nindices = 0; // { -// Iterator<WeakReference<IRawStore>> itr = storeCache.iterator(); +// Iterator<WeakReference<IStoreFile>> itr = storeCache.iterator(); // while (itr.hasNext()) { -// IRawStore store = itr.next().get(); +// IStoreFile store = itr.next().get(); // if (store != null) { // log.warn("Store: " + store); // nstores++; @@ -3837,7 +3818,7 @@ */ { - final IRawStore store = storeCache.remove(uuid); + final IStoreFile store = storeCache.remove(uuid); if (store != null) { @@ -4094,7 +4075,7 @@ */ { - final IRawStore store = storeCache.remove(uuid); + final IStoreFile store = storeCache.remove(uuid); if (store != null) { Modified: branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/service/jini/util/DumpFederation.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/service/jini/util/DumpFederation.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/main/java/com/bigdata/service/jini/util/DumpFederation.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -49,6 +49,7 @@ import java.util.concurrent.TimeoutException; import com.bigdata.io.BytesUtil; +import com.bigdata.journal.IStoreFile; import net.jini.config.ConfigurationException; import net.jini.core.entry.Entry; import net.jini.core.lookup.ServiceItem; @@ -72,7 +73,6 @@ import com.bigdata.mdi.IResourceMetadata; import com.bigdata.mdi.LocalPartitionMetadata; import com.bigdata.mdi.PartitionLocator; -import com.bigdata.rawstore.IRawStore; import com.bigdata.resources.ResourceManager; import com.bigdata.resources.StoreManager; import com.bigdata.resources.StoreManager.ManagedJournal; @@ -1379,7 +1379,7 @@ * expensive IO. */ - final IRawStore store = resourceManager.getJournal(timestamp); + final IStoreFile store = resourceManager.getJournal(timestamp); if (store == null) { @@ -1441,7 +1441,7 @@ * IndexSegmentStore, but not of the IndexSegment on that * store! */ - final IRawStore store = resourceManager.openStore(x + final IStoreFile store = resourceManager.openStore(x .getUUID()); if (store == null) { Modified: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestAll_IndexSegment.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestAll_IndexSegment.java 2010-09-24 17:25:48 UTC (rev 3626) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestAll_IndexSegment.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -65,7 +65,9 @@ * * See DumpIndexSegment. */ - + + //basic unit tests for IndexSegment. + suite.addTestSuite(TestIndexSegment.class); // test static methods for the index builder. suite.addTestSuite(TestIndexSegmentPlan.class); // test encoding and decoding of child node/leaf addresses. Added: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java =================================================================== --- branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java (rev 0) +++ branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java 2010-09-24 17:46:05 UTC (rev 3627) @@ -0,0 +1,81 @@ +/* + * Created by IntelliJ IDEA. + * User: gossard + * Date: Sep 23, 2010 + * Time: 2:40:27 PM + */ +package com.bigdata.btree; + +import com.bigdata.mdi.IResourceMetadata; +import com.bigdata.mdi.SegmentMetadata; +import com.bigdata.rawstore.SimpleMemoryRawStore; +import junit.framework.TestCase; + +import java.io.File; +import java.util.UUID; + +/** + * Basic unit tests for IndexSegment class. + */ +public class TestIndexSegment extends TestCase { + File outputDirectory; + File outputFile; + + BTree sampleTree; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + outputFile = new File(getClass().getName() + ".seg").getAbsoluteFile(); + outputDirectory = outputFile.getParentFile(); + + if ( outputFile.exists() && !outputFile.delete() ) + throw new RuntimeException("Could not delete test file -" + outputFile.getAbsolutePath()); + + //just to be sure. + outputFile.deleteOnExit(); + + + + sampleTree = BTree.create(new SimpleMemoryRawStore(), + new IndexMetadata(UUID.randomUUID()) + ); + + for (int i = 0;i < 10;i++) + sampleTree.insert("key-"+i, "value-"+i); + + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + outputFile.delete(); + } + + public void test_verify_getResourceMetadata() throws Exception { + //write segment file from sample tree to disk. + IndexSegmentCheckpoint checkpoint = IndexSegmentBuilder + .newInstance(outputFile, outputDirectory, sampleTree.getEntryCount(), + sampleTree.rangeIterator(), 3, sampleTree.getIndexMetadata(), + System.currentTimeMillis() , true/* compactingMerge */, true /*bufferNodes*/) + .call(); + + //load the segment file from disk. + IndexSegmentStore segStore = new IndexSegmentStore(outputFile); + IndexSegment seg = segStore.loadIndexSegment(); + + IResourceMetadata[] metaList = seg.getResourceMetadata(); + assertNotNull("cannot return null",metaList); + assertEquals("must return only one item", 1, metaList.length); + assertNotNull("item cannot be null",metaList[0]); + assertTrue("resource metadata for IndexSegment must be instanceof SegmentMetadata", (metaList[0] instanceof SegmentMetadata) ); + + SegmentMetadata meta = (SegmentMetadata)metaList[0]; + assertTrue("index segment metadata must return true for isIndexSegment()", meta.isIndexSegment() ); + assertFalse("index segment metadata must return false for isJournal()", meta.isJournal() ); + + //expect short filename like 'foo.seg' , not absolute path. + assertEquals("index metadata backing filename wasn't same as original?", outputFile.getName() , meta.getFile() ); + } +} \ No newline at end of file Property changes on: branches/maven_scaleout/bigdata-core/src/test/java/com/bigdata/btree/TestIndexSegment.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2010-09-24 17:25:54
|
Revision: 3626 http://bigdata.svn.sourceforge.net/bigdata/?rev=3626&view=rev Author: mrpersonick Date: 2010-09-24 17:25:48 +0000 (Fri, 24 Sep 2010) Log Message: ----------- no longer punt to Sesame when exceptions are thrown from our query engine Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-24 17:18:40 UTC (rev 3625) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-24 17:25:48 UTC (rev 3626) @@ -483,16 +483,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation - - ex.printStackTrace(); + throw new QueryEvaluationException(ex); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(union, bindings); - return super.evaluate(union, bindings); - } } @@ -617,16 +619,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation + throw new QueryEvaluationException(ex); - ex.printStackTrace(); +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(join, bindings); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } - - return super.evaluate(join, bindings); - } } @@ -721,16 +725,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation + throw new QueryEvaluationException(ex); - ex.printStackTrace(); +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(join, bindings); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } - - return super.evaluate(join, bindings); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ble...@us...> - 2010-09-24 17:18:47
|
Revision: 3625 http://bigdata.svn.sourceforge.net/bigdata/?rev=3625&view=rev Author: blevine218 Date: 2010-09-24 17:18:40 +0000 (Fri, 24 Sep 2010) Log Message: ----------- add bigdata-integ module Modified Paths: -------------- branches/maven_scaleout/pom.xml Modified: branches/maven_scaleout/pom.xml =================================================================== --- branches/maven_scaleout/pom.xml 2010-09-24 16:49:51 UTC (rev 3624) +++ branches/maven_scaleout/pom.xml 2010-09-24 17:18:40 UTC (rev 3625) @@ -20,6 +20,7 @@ <modules> <module>bigdata-core</module> + <module>bigdata-integ</module> </modules> <build> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |