From: <tho...@us...> - 2010-08-18 20:56:09
|
Revision: 3448 http://bigdata.svn.sourceforge.net/bigdata/?rev=3448&view=rev Author: thompsonbry Date: 2010-08-18 20:55:58 +0000 (Wed, 18 Aug 2010) Log Message: ----------- Mapped out the " Added tuprolog dependency (LGPL), but I have not done anything yet to integrate it. It will be used to do query plan rewrites. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/.classpath branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/IRelation.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/RelationFusedView.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/AbstractAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/AccessPathFusedView.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/EmptyAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/IAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/IElementFilter.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/accesspath/SameVariableConstraint.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/DefaultSolutionExpander.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IProgram.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IQueryOptions.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IRule.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/ISolutionExpander.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/ISortOrder.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IStarJoin.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/Rule.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/SortOrder.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/AbstractStepTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/DefaultEvaluationPlan2.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/DefaultRangeCountFactory.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/DefaultRuleTaskFactory.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/IJoinNexus.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/IRangeCountFactory.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/IRuleState.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/ISolution.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/NestedSubqueryWithJoinThreadsTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/NoReorderEvaluationPlan.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/RuleLog.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/RuleState.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/RuleStats.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/Solution.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/SolutionFilter.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/DistributedJoinMasterTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/DistributedJoinTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/IJoinMaster.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinMasterTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinTaskFactoryTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinTaskSink.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/LocalJoinMasterTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/LocalJoinTask.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/UnsyncDistributedOutputBuffer.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/UnsyncLocalOutputBuffer.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/UnsynchronizedOutputBuffer.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/UnsynchronizedSolutionBuffer.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/search/FullTextIndex.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/FederationCallable.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/IFederationCallable.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/proxy/RemoteAsynchronousIterator.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/striterator/Filter.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/striterator/IKeyOrder.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/util/NV.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/accesspath/TestSameVariableConstraint.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/locator/TestDefaultResourceLocator.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/AbstractRuleTestCase.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestRule.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/eval/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/eval/TestDefaultEvaluationPlan.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/eval/TestRuleState.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/inf/Justification.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/inf/OwlSameAsPropertiesExpandingIterator.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/DummyIV.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/AbstractInlineConstraint.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineEQ.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGE.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGT.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLE.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLT.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineNE.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/magic/IRISUtils.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicPredicate.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicRelation.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicTuple.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/BindingSetSortKeyBuilder.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleDistinctTermScan.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_11_13.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_3_5_6_7_9.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_5_6_7_9.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/BackchainAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/FastClosure.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/MatchRule.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RDFJoinNexus.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RDFJoinNexusFactory.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RejectAnythingSameAsItself.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleContextEnum.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleFastClosure11.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleFastClosure13.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleFastClosure3.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlInverseOf1.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlSameAs1.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlSameAs1b.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlSameAs2.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlSameAs3.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlTransitiveProperty1.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleOwlTransitiveProperty2.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleRdfs05.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleRdfs07.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleRdfs09.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleRdfs11.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/SPOBindingSetSerializer.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/rules/TMUtility.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/DefaultGraphSolutionExpander.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/NamedGraphSolutionExpander.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/NoAxiomFilter.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOFilter.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOKeyOrder.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOPredicate.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPORelation.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOStarJoin.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataSolutionResolverator.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/vocab/BaseVocabulary.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/vocab/Vocabulary.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestIRIS.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestMagicStore.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/AbstractRuleTestCase.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestJustifications.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestMatch.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestOptionals.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestRuleExpansion.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestRuleFastClosure_3_5_6_7_9.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestSlice.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOAccessPath.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOKeyOrder.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOPredicate.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPORelation.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOStarJoin.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/Bigdata2Sesame2BindingSetIterator.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl2.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/FreeTextSearchExpander.java Added Paths: ----------- branches/QUADS_QUERY_BRANCH/bigdata/lib/tuprolog/ branches/QUADS_QUERY_BRANCH/bigdata/lib/tuprolog/tuprolog-v2.1.1.jar branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractBOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractPipelineOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractSampleIndex.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ArrayBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpList.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpUtility.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BindingSetPipelineOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ChunkedOrderedIteratorOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/Constant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ConstantEval.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/Distinct.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/EmptyBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/HashBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IConstraint.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IPredicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IVariable.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/IVariableOrConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/NV.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/PipelineOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/QuoteOp.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/SampleLocalBTree.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/SampleLocalShard.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/Var.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Predicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/Union.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ap/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/bop-notes.txt branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/ 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/IN.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/java/com/bigdata/bop/constraint/OR.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/JoinGraph.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/eval/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/fed/ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/fed/MapBindingSetsOverShards.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/fed/ReceiveBindingSets.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/fed/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/IJoinMaster.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/JoinStats.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/package.html branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinStats.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/TestBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/TestConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/TestVar.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/ap/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/ap/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/ap/TestPredicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/eval/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/eval/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/eval/TestJoinGraph.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestMapBindingSetsOverNodes.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestMapBindingSetsOverShards.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/fed/TestSendReceiveBuffers.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/join/ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/join/TestAll.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/join/TestPipelineJoin.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/AbstractEmbeddedDataService.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/AbstractEmbeddedLoadBalancerService.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/AbstractEmbeddedTransactionService.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/EmbeddedClient.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/EmbeddedFederation.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/service/EmbeddedMetadataService.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/Binding.java branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/IBinding.java Removed Paths: ------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/ArrayBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/Binding.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/Constant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/EQ.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/EQConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/EmptyBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/HashBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IBinding.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IConstraint.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IN.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IPredicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IVariable.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/IVariableOrConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/NE.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/NEConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/OR.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/Predicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/Var.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/DHTFilterFactory.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinStats.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractEmbeddedDataService.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractEmbeddedLoadBalancerService.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/AbstractEmbeddedTransactionService.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/EmbeddedClient.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/EmbeddedFederation.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/service/EmbeddedMetadataService.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestBindingSet.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestConstant.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestPredicate.java branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/relation/rule/TestVar.java Modified: branches/QUADS_QUERY_BRANCH/.classpath =================================================================== --- branches/QUADS_QUERY_BRANCH/.classpath 2010-08-18 20:04:48 UTC (rev 3447) +++ branches/QUADS_QUERY_BRANCH/.classpath 2010-08-18 20:55:58 UTC (rev 3448) @@ -21,6 +21,7 @@ <classpathentry kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/> <classpathentry kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/> <classpathentry kind="lib" path="bigdata-rdf/lib/nxparser-6-22-2010.jar"/> + <classpathentry kind="lib" path="bigdata/lib/tuprolog/tuprolog-v2.1.1.jar"/> <classpathentry kind="src" path="lgpl-utils/src/java"/> <classpathentry kind="src" path="lgpl-utils/src/test"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-3_6.jar"/> Added: branches/QUADS_QUERY_BRANCH/bigdata/lib/tuprolog/tuprolog-v2.1.1.jar =================================================================== (Binary files differ) Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/lib/tuprolog/tuprolog-v2.1.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractBOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractBOp.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractBOp.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,212 @@ +/** + +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 Aug 16, 2010 + */ + +package com.bigdata.bop; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import com.bigdata.bop.constraint.EQ; + +/** + * Abstract base class for {@link BOp}s. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +abstract public class AbstractBOp implements BOp { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The argument values. + * <p> + * Note: This field is reported out as a {@link List} so we can make it + * thread safe and, if desired, immutable. However, it is internally a + * simple array and exposed to subclasses so they can benefit from fast + * positional access to the arguments in operations which would otherwise + * become hot, such as {@link EQ#accept(IBindingSet)}. + * <p> + * If we allow mutation of the arguments then caching of the arguments (or + * annotations) by classes such as {@link EQ} will cause {@link #clone()} to + * fail because (a) it will do a field-by-field copy on the concrete + * implementation class; and (b) it will not consistently update the cached + * references. In order to "fix" this problem, any classes which cache + * arguments or annotations would have to explicitly overrides + * {@link #clone()} in order to set those fields based on the arguments on + * the cloned {@link AbstractBOp} class. + */ + protected final BOp[] args; + + /** + * The operator annotations. + */ + protected final Map<String,Object> annotations; + + /** + * Check the operator argument. + * + * @param args + * The arguments. + * + * @throws IllegalArgumentException + * if the arguments are not valid for the operator. + */ + protected void checkArgs(final Object[] args) { + + } + + /** + * Deep copy clone semantics for {@link #args} and {@link #annotations}. + * <p> + * {@inheritDoc} + * + * @todo This will deep copy {@link BOp} structures but does not do a deep + * copy of other kinds of embedded structures. + */ + public AbstractBOp clone() { + try { + final AbstractBOp tmp = (AbstractBOp) super.clone(); + // deep copy the arguments. + { + final int arity = arity(); + for (int i = 0; i < arity; i++) { + tmp.args[i] = (BOp) (args[i].clone()); + } + } + // deep copy the annotations. + { + final Iterator<Map.Entry<String, Object>> itr = annotations + .entrySet().iterator(); + while (itr.hasNext()) { + final Map.Entry<String, Object> e = itr.next(); + if (e.getValue() instanceof BOp) { + tmp.annotations.put(e.getKey(), ((BOp) e.getValue()) + .clone()); + } + } + } + return tmp; + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } + + /** + * @param args + * The arguments to the operator. + */ + protected AbstractBOp(final BOp[] args) { + + this(args, null/* annotations */); + + } + + /** + * @param args + * The arguments to the operator. + * @param annotations + * The annotations for the operator (optional). + */ + protected AbstractBOp(final BOp[] args, + final Map<String, Object> annotations) { + + if (args == null) + throw new IllegalArgumentException(); + + checkArgs(args); + + final ArrayList<BOp> tmp = new ArrayList<BOp>(args.length); + + for (int i = 0; i < args.length; i++) { + + tmp.add(args[i]); + + } + + this.args = args; + + this.annotations = (annotations == null ? new LinkedHashMap<String, Object>() + : annotations); + + } + + final public Map<String, Object> annotations() { + + return Collections.unmodifiableMap(annotations); + + } + + public BOp get(final int index) { + + return args[index]; + + } + + public int arity() { + + return args.length; + + } + + final public List<BOp> args() { + + return Collections.unmodifiableList(Arrays.asList(args)); + + } + + /** + * Return the value of the named annotation. + * + * @param name + * The name of the annotation. + * @param defaultValue + * The default value. + * @return The annotation value -or- the <i>defaultValue</i> if the + * annotation was not bound. + * @param <T> + * The generic type of the annotation value. + */ + @SuppressWarnings("unchecked") + public <T> T getProperty(final String name, final T defaultValue) { + + if (!annotations.containsKey(name)) + return defaultValue; + + return (T) annotations.get(name); + + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractBOp.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,97 @@ +/** + +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 Aug 18, 2010 + */ + +package com.bigdata.bop; + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +abstract public class AbstractChunkedOrderedIteratorOp<E> extends AbstractBOp + implements ChunkedOrderedIteratorOp<E> { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public interface Annotations extends ChunkedOrderedIteratorOp.Annotations { + + } + + /** + * @param args + */ + protected AbstractChunkedOrderedIteratorOp(BOp[] args) { + super(args); + } + + /** + * @param args + * @param annotations + */ + protected AbstractChunkedOrderedIteratorOp(BOp[] args, Map<String, Object> annotations) { + super(args, annotations); + } + + protected int getChunkCapacity() { + + return getProperty(Annotations.CHUNK_CAPACITY, + Annotations.DEFAULT_CHUNK_CAPACITY); + + } + + protected int getChunkOfChunksCapacity() { + + return getProperty(Annotations.CHUNK_OF_CHUNKS_CAPACITY, + Annotations.DEFAULT_CHUNK_OF_CHUNKS_CAPACITY); + + } + + protected int getFullyBufferedReadThreshold() { + + return getProperty(Annotations.FULLY_BUFFERED_READ_THRESHOLD, + Annotations.DEFAULT_FULLY_BUFFERED_READ_THRESHOLD); + + } + + protected long getChunkTimeout() { + + return getProperty(Annotations.CHUNK_TIMEOUT, + Annotations.DEFAULT_CHUNK_TIMEOUT); + + } + + /** + * The {@link TimeUnit}s in which the {@link #chunkTimeout} is measured. + */ + protected static transient final TimeUnit chunkTimeoutUnit = TimeUnit.MILLISECONDS; + +} Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractChunkedOrderedIteratorOp.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractPipelineOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractPipelineOp.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractPipelineOp.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,96 @@ +/** + +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 Aug 18, 2010 + */ + +package com.bigdata.bop; + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import com.bigdata.relation.accesspath.BlockingBuffer; +import com.bigdata.relation.accesspath.IBlockingBuffer; + +/** + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +abstract public class AbstractPipelineOp<E> extends AbstractBOp implements + PipelineOp<E> { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public interface Annotations extends BindingSetPipelineOp.Annotations { + + } + + /** + * @param args + * @param annotations + */ + protected AbstractPipelineOp(final BOp[] args, + final Map<String, Object> annotations) { + + super(args, annotations); + + } + + protected int getChunkCapacity() { + + return getProperty(Annotations.CHUNK_CAPACITY, + Annotations.DEFAULT_CHUNK_CAPACITY); + + } + + protected int getChunkOfChunksCapacity() { + + return getProperty(Annotations.CHUNK_OF_CHUNKS_CAPACITY, + Annotations.DEFAULT_CHUNK_OF_CHUNKS_CAPACITY); + + } + + protected long getChunkTimeout() { + + return getProperty(Annotations.CHUNK_TIMEOUT, + Annotations.DEFAULT_CHUNK_TIMEOUT); + + } + + /** + * The {@link TimeUnit}s in which the {@link #chunkTimeout} is measured. + */ + protected static transient final TimeUnit chunkTimeoutUnit = TimeUnit.MILLISECONDS; + + public IBlockingBuffer<E[]> newBuffer() { + + return new BlockingBuffer<E[]>(getChunkOfChunksCapacity(), + getChunkCapacity(), getChunkTimeout(), chunkTimeoutUnit); + + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractPipelineOp.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractSampleIndex.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractSampleIndex.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractSampleIndex.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,101 @@ +/** + +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 Aug 16, 2010 + */ + +package com.bigdata.bop; + + +import com.bigdata.btree.IIndex; +import com.bigdata.relation.accesspath.IAccessPath; + +/** + * Abstract base class for sampling operator for an {@link IIndex}. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + * @param <E> + * The generic type of the elements materialized from that index. + * + * @todo Implement sample operator. E.g., sampleRange(fromKey,toKey,limit). This + * could be on {@link IIndex} or on {@link IAccessPath}. For a shard view, + * it must proportionally select from among the ordered components of the + * view. For a hash table it would be sample(limit) since range based + * operations are not efficient. + * <p> + * This should accept an index, not a predicate (for RDF we determine the + * index an analysis of the bound and unbound arguments on the predicate + * and always have a good index, but this is not true in the general + * case). When the index is remote, it should be executed at the remote + * index. + * + * @todo This needs to operation on element chunks, not {@link IBindingSet} + * chunks. It also may not require pipelining. + */ +abstract public class AbstractSampleIndex<E> extends AbstractPipelineOp<E> { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Known annotations. + */ + public interface Annotations extends BOp.Annotations { + /** + * The sample limit. + */ + String LIMIT = "limit"; + } + + protected AbstractSampleIndex(final IPredicate<E> pred, final int limit) { + + super(new BOp[] { pred }, NV.asMap(new NV[] {// + new NV(Annotations.LIMIT, Integer.valueOf(limit)) // + })); + + if (pred == null) + throw new IllegalArgumentException(); + + if (limit <= 0) + throw new IllegalArgumentException(); + + } + + @SuppressWarnings("unchecked") + public IPredicate<E> pred() { + + return (IPredicate<E>) args[0]; + + } + + public int limit() { + + return (Integer) annotations.get(Annotations.LIMIT); + + } + +} Property changes on: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/AbstractSampleIndex.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL Copied: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ArrayBindingSet.java (from rev 3423, branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/relation/rule/ArrayBindingSet.java) =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ArrayBindingSet.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/ArrayBindingSet.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,443 @@ +/* + +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 Jun 20, 2008 + */ + +package com.bigdata.bop; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.log4j.Logger; + +/** + * An {@link IBindingSet} backed by an dense array (no gaps). This + * implementation is more efficient for fixed or small N (N LTE ~20). It simples + * scans the array looking for the variable using references tests for equality. + * Since the #of variables is generally known in advance this can be faster and + * lighter than {@link HashBindingSet} for most applications. + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public class ArrayBindingSet implements IBindingSet { + + private static final long serialVersionUID = -6468905602211956490L; + + protected static final Logger log = Logger.getLogger(ArrayBindingSet.class); + + /** + * True iff the {@link #log} level is INFO or less. + */ + protected static final boolean INFO = log.isInfoEnabled(); + + /** + * True iff the {@link #log} level is DEBUG or less. + */ + protected static final boolean DEBUG = log.isDebugEnabled(); + + /** + * A dense array of the bound variables. + */ + private final IVariable[] vars; + /** + * A dense array of the values bound to the variables (correlated with + * {@link #vars}). + */ + private final IConstant[] vals; + + private int nbound = 0; + + /** + * Copy constructor. + */ + protected ArrayBindingSet(ArrayBindingSet bindingSet) { + + if (bindingSet == null) + throw new IllegalArgumentException(); + + nbound = bindingSet.nbound; + + vars = bindingSet.vars.clone(); + + vals = bindingSet.vals.clone(); + + } + + /** + * Initialized with the given bindings (assumes for efficiency that all + * elements of bound arrays are non-<code>null</code> and that no + * variables are duplicated). + * + * @param vars + * The variables. + * @param vals + * Their bound values. + */ + public ArrayBindingSet(IVariable[] vars, IConstant[] vals) { + +// if (vars == null) +// throw new IllegalArgumentException(); +// +// if (vals == null) +// throw new IllegalArgumentException(); + + assert vars != null; + assert vals != null; + assert vars.length == vals.length; + + // for (int i = 0; i < vars.length; i++) { + // + // if (vars[i] == null) + // throw new IllegalArgumentException(); + // + // if (vals[i] == null) + // throw new IllegalArgumentException(); + // + // } + + this.vars = vars; + + this.vals = vals; + + this.nbound = vars.length; + + } + + /** + * Initialized with the given capacity. + * + * @param capacity + * The capacity. + * + * @throws IllegalArgumentException + * if the <i>capacity</i> is negative. + */ + public ArrayBindingSet(int capacity) { + + if (capacity < 0) + throw new IllegalArgumentException(); + + vars = new IVariable[capacity]; + + vals = new IConstant[capacity]; + + } + + public Iterator<IVariable> vars() { + + return Collections.unmodifiableList(Arrays.asList(vars)).iterator(); + + } + + /** + * Iterator does not support either removal or concurrent modification of + * the binding set. + */ + public Iterator<Map.Entry<IVariable,IConstant>> iterator() { + + return new BindingSetIterator(); + + } + + private class BindingSetIterator implements Iterator<Map.Entry<IVariable,IConstant>> { + + private int i = 0; + + public boolean hasNext() { + + return i < nbound; + + } + + public Entry<IVariable, IConstant> next() { + + // the index whose bindings are being returned. + final int index = i++; + + return new Map.Entry<IVariable, IConstant>() { + + public IVariable getKey() { + + return vars[index]; + + } + + public IConstant getValue() { + + return vals[index]; + + } + + public IConstant setValue(IConstant value) { + + if (value == null) + throw new IllegalArgumentException(); + + final IConstant t = vals[index]; + + vals[index] = value; + + return t; + + } + + }; + + } + + public void remove() { + + throw new UnsupportedOperationException(); + + } + + } + + public int size() { + + return nbound; + + } + + public void clearAll() { + + for (int i = nbound - 1; nbound > 0; i--, nbound--) { + + vars[i] = null; + + vals[i] = null; + + } + + assert nbound == 0; + + } + + /** + * Since the array is dense (no gaps), {@link #clear(IVariable)} requires + * that we copy down any remaining elements in the array by one position. + */ + public void clear(IVariable var) { + + if (var == null) + throw new IllegalArgumentException(); + + for (int i = 0; i < nbound; i++) { + + if (vars[i] == var) { + + final int nremaining = nbound-(i+1); + + if (nremaining >= 0) { + + // Copy down to close up the gap! + System.arraycopy(vars, i+1, vars, i, nremaining); + + System.arraycopy(vals, i+1, vals, i, nremaining); + + } else { + + // Just clear the reference. + + vars[i] = null; + + vals[i] = null; + + } + + nbound--; + + break; + + } + + } + + } + + public IConstant get(IVariable var) { + + if (var == null) + throw new IllegalArgumentException(); + + for (int i = 0; i < nbound; i++) { + + if (vars[i] == var) { + + return vals[i]; + + } + + } + + return null; + + } + + public boolean isBound(IVariable var) { + + return get(var) != null; + + } + + public void set(final IVariable var, final IConstant val) { + + if (var == null) + throw new IllegalArgumentException(); + + if (val == null) + throw new IllegalArgumentException(); + + if(DEBUG) { + + log.debug("var=" + var + ", val=" + val + ", nbound=" + nbound+", capacity="+vars.length); + + } + + for (int i = 0; i < nbound; i++) { + + if (vars[i] == var) { + + vals[i] = val; + + return; + + } + + } + + vars[nbound] = var; + + vals[nbound] = val; + + nbound++; + + } + + public String toString() { + + StringBuilder sb = new StringBuilder(); + + sb.append("{"); + + for(int i=0; i<nbound; i++) { + + if(i>0) sb.append(", "); + + sb.append(vars[i]); + + sb.append("="); + + sb.append(vals[i]); + + } + + sb.append("}"); + + return sb.toString(); + + } + + public ArrayBindingSet clone() { + + return new ArrayBindingSet(this); + + } + + /** + * Return a shallow copy of the binding set, eliminating unecessary + * variables. + */ + public ArrayBindingSet copy(final IVariable[] variablesToKeep) { + + // bitflag for the old binding set + final boolean[] keep = new boolean[nbound]; + + // for each var in the old binding set, see if we need to keep it + for (int i = 0; i < nbound; i++) { + + final IVariable v = vars[i]; + + keep[i] = false; + for (IVariable k : variablesToKeep) { + if (v == k) { + keep[i] = true; + break; + } + } + + } + + // allocate the new vars + final IVariable[] newVars = new IVariable[vars.length]; + + // allocate the new vals + final IConstant[] newVals = new IConstant[vals.length]; + + // fill in the new binding set based on the keep bitflag + int newbound = 0; + for (int i = 0; i < nbound; i++) { + if (keep[i]) { + newVars[newbound] = vars[i]; + newVals[newbound] = vals[i]; + newbound++; + } + } + + ArrayBindingSet bs = new ArrayBindingSet(newVars, newVals); + bs.nbound = newbound; + + return bs; + + } + + public boolean equals(IBindingSet o) { + + if (o == this) + return true; + + if (nbound != o.size()) + return false; + + for(int i=0; i<nbound; i++) { + +// if (!o.isBound(vars[i])) +// return false; + + if (!vals[i].equals(o.get(vars[i]))) + return false; + + } + + return true; + + } + +} Added: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java (rev 0) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOp.java 2010-08-18 20:55:58 UTC (rev 3448) @@ -0,0 +1,218 @@ +/** + +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 Aug 12, 2010 + */ + +package com.bigdata.bop; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + + +/** + * An operator, such as a constant, variable, join, sort, filter, etc. Operators + * are organized in a tree of operators. The arity of an operator is the number + * of children declared by that operator class. The children of an operator are + * themselves operators and traversal is supported between a parent and its + * children. In addition to their arguments, operators may have a variety of + * annotations, including those specific to an operator (such as the maximum + * number of iterators for a closure operator), those shared by many operators + * (such as set of variables which are selected by a join or distributed hash + * table), or those shared by all operators (such as a cost model). + * <p> + * Operators are mutable, thread-safe, {@link Serializable} to facilitate + * distributed computing, and {@link Cloneable} to facilitate non-destructive + * tree rewrites. + * <p> + * What follows is a summary of some of the more important kinds of operations. + * For each type of operation, there may be several implementations. One common + * way in which implementations of the same operator may differ is whether they + * are designed for low-volume selective queries or high volume unselective + * queries. + * <dl> + * <dt>JOINs</dt> + * <dd></dd> + * <dt>Mapping binding sets across shards (key-range partitions) or nodes (hash + * partitioned)</dt> + * <dd></dd> + * <dt>Predicates and access paths</dt> + * <dd></dd> + * <dt>SORT</dt> + * <dd></dd> + * <dt>DISTINCT</dt> + * <dd></dd> + * <dt>Element filters</dt> + * <dd></dd> + * <dt>Rule constraints</dt> + * <dd></dd> + * <dt>Binding set filters (removing binding sets which are not required outside + * of some context)</dt> + * <dd></dd> + * <dt>Identifiers for sinks to which binding sets can be written and + * conditional routing of binding sets, for example based on variable value or + * type or join success or failure</dt> + * <dd></dd> + * <dt>Sequential or iterative programs.</dt> + * <dd></dd> + * <dt>Creating or destroying transient or persistent resources (graphs, tables, + * DHTs, etc). Such life cycle operators dominate the subtree within which the + * resource will be utilized.</dt> + * <dd></dd> + * <dt>Export of proxy objects, especially for query or mutation buffers.</dt> + * <dd></dd> + * </dl> + * + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + * + * @todo javadoc review and reconcile with notes. + */ +public interface BOp extends Cloneable, Serializable { + + /** + * The #of arguments to the operation. + */ + int arity(); + + /** + * Return an argument to the operation. + * + * @param index + * The argument index in [0:{@link #arity()}-1]. + * + * @return The argument. + */ + BOp get(int index); + +// /** +// * Bind an argument of the operation. +// * +// * @param index +// * The argument index in [0:{@link #arity()}-1]. +// * @param newValue +// * The bound value. +// * +// * @return A copy of the operation having the bound value for the argument. +// */ +// BOp<?> setArg(int index, BOp<?> newValue); + +// /** +// * Return the value of the named operator annotation. +// * +// * @param name +// * The annotation name. +// * +// * @return The value of the named operator annotation. +// */ +// Object getProperty(String name); + +// /** +// * Set the value of the named operator annotation. +// * +// * @param name +// * The annotation name. +// * @param newValue +// * The new value for the named annotation, +// * +// * @return The old value of the named operator annotation. +// */ +// Object setProperty(String name,Object newValue); + +// /** +// * Return the type constraint on the specified argument. +// * +// * @param index +// * The argument index in [0:{@link #arity()}-1]. +// * +// * @return The type constraint on that argument. +// */ +// Class<?> getArgType(int index); + +// /** +// * The type of the values produced by the operation (Constant or variable, +// * primitive?, relation, triple store, index, file, bat, ...). +// */ +// Class<T> getResultType(); + +// /** +// * @TODO There needs to be some simple evaluation path for things such as +// * native SPARQL operations. This is currently +// * {@link IConstraint#accept(IBindingSet)}, which returns a truth +// * value. This seems quite adequate. +// */ +// boolean accept(IBindingSet bset); + +// /** +// * The #of arguments to this operation which are variables. This method does +// * not report on... [truncated message content] |