public class AST2BOpContext extends Object implements IdFactory, IEvaluationContext
| Modifier and Type | Field and Description |
|---|---|
int |
accessPathSampleLimit
The #of samples to take when comparing the cost of a SCAN with an IN
filter to as-bound evaluation for each graph in the data set.
|
boolean |
accessPathScanAndFilter
For named and default graph access paths where access path cost
estimation is disabled by setting the
accessPathSampleLimit to
ZERO (0), this determines whether a SCAN + FILTER or PARALLEL SUBQUERY
(aka as-bound data set join) approach. |
ASTContainer |
astContainer
The
ASTContainer and never null. |
boolean |
constructDistinctSPO
Set by the
ConstructDistinctSPOHint. |
BOpContextBase |
context
Factory for resolving relations and access paths used primarily by
AST2BOpJoinss. |
protected AbstractTripleStore |
db
The KB instance.
|
boolean |
defaultGraphDistinctFilter
Whether or not a distinct filter is applied over triples extracted from
the default graph (applies in quads mode only).
|
IDescribeCache |
describeCache
The
IDescribeCache -or- null iff that cache is not
enabled.. |
IExternalAST2BOp |
gpuEvaluation
The
IExternalAST2BOp for using GPUs or null. |
int |
maxParallelForSolutionSetHashJoin
The maximum parallelism for a solution set hash join when the join is
used in a context that does permit parallelism, such as sub-group and
sub-query evaluation (default
).
|
boolean |
mergeJoin
When
true, a merge-join pattern will be recognized if it
appears in a join group. |
boolean |
nativeDistinctSolutions
When
true, will use the version of the DISTINCT SOLUTIONS
operator which uses the HTree against the native heap. |
boolean |
nativeDistinctSPO
When
true, may use the version of DISTINCT which operates on
the native heap (this is only used when we are doing a hash join against
a default graph access path and the predicate for that access path has a
large cardinality). |
long |
nativeDistinctSPOThreshold
The threshold at which we will use a native hash set rather than a
default hash set for a default graph access path.
|
boolean |
nativeHashJoins
When
true, use hash index operations based on the
HTree. |
ASTOptimizerList |
optimizers
The query optimizers (this includes both query rewrites for correct
semantics, such as a rewrite of a DESCRIBE query into a CONSTRUCT query,
and query rewrites for performance optimizations).
|
boolean |
pipelinedHashJoins
When
true, use pipelined hash join operations wherever
possible. |
QueryEngine |
queryEngine
The
QueryEngine. |
IChunkHandler |
queryEngineChunkHandler
Controls whether the intermediate solution chunks on the query engine
operator input queues are stored on the native heap and/or the managed
object heap.
|
Properties |
queryHints
The query hints from the original
#query. |
UUID |
queryId
The unique identifier assigned to this query.
|
boolean |
remoteAPs
When
true, force the use of REMOTE access paths in scale-out
joins. |
ISolutionSetManager |
solutionSetManager
The
ISolutionSetManager -or- null iff that cache is not
enabled. |
| Constructor and Description |
|---|
AST2BOpContext(ASTContainer astContainer,
AbstractTripleStore db) |
| Modifier and Type | Method and Description |
|---|---|
void |
addQueryAttribute(Object key,
Object val) |
String |
createVar(String prefix)
Create a new variable name which is unique within the scope of this
AST2BOpContext. |
AbstractTripleStore |
getAbstractTripleStore()
Return the database.
|
BOpContextBase |
getBOpContext()
Return the context for evaluation of
IValueExpressions during
query optimization. |
IDescribeCache |
getDescribeCache()
Return the cache for described resources (experimental feature).
|
int |
getDescribeIterationLimit(ProjectionNode projection)
Return the effective iteration limit for a DESCRIBE query.
|
DescribeModeEnum |
getDescribeMode(ProjectionNode projection)
Return the effective
DescribeModeEnum. |
int |
getDescribeStatementLimit(ProjectionNode projection)
Return the effective statement limit for a DESCRIBE query.
|
Set<IVariable<?>> |
getGloballyScopedVariables()
Returns all the variables with a global scope.
|
String |
getLexiconNamespace()
Return the namespace of the
LexiconRelation. |
long |
getLexiconReadTimestamp()
Return the timestamp which will be used to read on the lexicon.
|
String |
getNamespace()
Return the namespace of the
AbstractTripleStore. |
Map<Object,Object> |
getQueryAttributes()
Return an optional (and immutable) map of key-value pairs that will be
attached to the
IRunningQuery on the query controller node. |
ISolutionSetManager |
getSolutionSetManager()
Return the manager for named solution sets (experimental feature).
|
ISolutionSetStats |
getSolutionSetStats()
Some summary statistics about the exogenous solution sets.
|
ISolutionSetStats |
getSolutionSetStats(String localName)
Resolve the pre-existing named solution set returning its
ISolutionSetStats. |
String |
getSPONamespace()
Return the namespace of the
SPORelation. |
StaticAnalysisStats |
getStaticAnalysisStats()
Summary statistics for the static analysis phase.
|
long |
getTimestamp()
The timestamp or transaction identifier associated with the view.
|
boolean |
isCluster()
Return
true if we are running on a cluster. |
boolean |
isQuads()
Return
true iff the target AbstractTripleStore is in
quads mode. |
boolean |
isSIDs()
Return
true iff the target AbstractTripleStore is in
SIDS mode. |
boolean |
isTriples()
Return
true iff the target AbstractTripleStore is in
triples mode. |
int |
nextId()
Issue the next bop identifier.
|
void |
setGloballyScopedVariables(Set<IVariable<?>> globallyScopedVariables)
Sets the variables with global scope.
|
void |
setSolutionSetStats(ISolutionSetStats stats)
Set the statistics summary for the exogenous solution sets.
|
void |
setStaticAnalysisStats(StaticAnalysisStats saStats)
Set the statistics object for the static analysis phase.
|
public final ASTContainer astContainer
ASTContainer and never null.protected final AbstractTripleStore db
public final QueryEngine queryEngine
QueryEngine.public final ISolutionSetManager solutionSetManager
ISolutionSetManager -or- null iff that cache is not
enabled.public final IDescribeCache describeCache
IDescribeCache -or- null iff that cache is not
enabled..public final Properties queryHints
#query.
Note: This acts as a default source for query hints to be applied to the
generated AST nodes. In addition, the ASTQueryHintOptimizer uses
registered IQueryHint implementations to annotate the original
AST as one of the steps when transforming it into the optimized AST. This
is done both for the global queryHintss and for magic predicates
using the QueryHints.NAMESPACE that appear in the query. Once a
query hint is set on an AST node, it will eventually be copied across to
PipelineOps generated from that AST node.
public final UUID queryId
QueryHints.QUERYID,
QueryEngine.Annotations#QUERY_IDpublic final ASTOptimizerList optimizers
public final BOpContextBase context
AST2BOpJoinss.public final IExternalAST2BOp gpuEvaluation
IExternalAST2BOp for using GPUs or null.public boolean nativeDistinctSPO
true, may use the version of DISTINCT which operates on
the native heap (this is only used when we are doing a hash join against
a default graph access path and the predicate for that access path has a
large cardinality).public long nativeDistinctSPOThreshold
public boolean nativeDistinctSolutions
true, will use the version of the DISTINCT SOLUTIONS
operator which uses the HTree against the native heap.QueryHints.NATIVE_DISTINCT_SOLUTIONSpublic IChunkHandler queryEngineChunkHandler
QueryHints.QUERY_ENGINE_CHUNK_HANDLER,
(Vector query engine on native heap)public boolean nativeHashJoins
true, use hash index operations based on the
HTree. Otherwise use hash index operations based on the Java
collection classes. The HTree is more scalable but has higher
overhead for small cardinality hash joins.QueryHints.NATIVE_HASH_JOINSpublic boolean pipelinedHashJoins
true, use pipelined hash join operations wherever
possible. Otherwise use standard, blocking hash joins (which might be
more efficient due to less memory overhead). Note that, even if this
is set to false, the system chooses pipelined hash joins
occasionally for queries with LIMIT.public boolean mergeJoin
true, a merge-join pattern will be recognized if it
appears in a join group. When false, this can still be
selectively enabled using a query hint.QueryHints.MERGE_JOINpublic int maxParallelForSolutionSetHashJoin
PipelineOp.Annotations#DEFAULT_MAX_PARALLEL. This parameter makes
it easier to re-test the effect of parallelism in these joins in the
future.AST2BOpUtility,
PipelineOp.Annotations#MAX_PARALLEL,
HTreeSolutionSetHashJoinOp,
JVMSolutionSetHashJoinOppublic boolean constructDistinctSPO
ConstructDistinctSPOHint. When false, no
DISTINCT SPO filter will be imposed by the ASTConstructIterator.(performance of dumping
single graph)public boolean remoteAPs
true, force the use of REMOTE access paths in scale-out
joins.public int accessPathSampleLimit
When ZERO (0), no cost estimation will be performed and the named graph or default graph join will always use the SCAN + FILTER approach.
public boolean accessPathScanAndFilter
accessPathSampleLimit to
ZERO (0), this determines whether a SCAN + FILTER or PARALLEL SUBQUERY
(aka as-bound data set join) approach.public boolean defaultGraphDistinctFilter
public AST2BOpContext(ASTContainer astContainer, AbstractTripleStore db)
astContainer - The top-level ASTContainer for the query or update
request to be evaluated (required).db - The KB instance.
TODO We should be passing in the IIndexManager rather
than the AbstractTripleStore in order to support cross
kb queries. The AST can be annotated with the namespace of the
default KB instance, which can then be resolved from the
IIndexManager. This would also allow us to clear up
the [lex] namespace parameter to the FunctionNode and
FunctionRegistry.public ISolutionSetStats getSolutionSetStats()
IEvaluationContextAST2BOpUtility.convert(AST2BOpContext, IBindingSet[])
before it begins to run the IASTOptimizers.getSolutionSetStats in interface IEvaluationContextpublic StaticAnalysisStats getStaticAnalysisStats()
IEvaluationContextgetStaticAnalysisStats in interface IEvaluationContextpublic void setSolutionSetStats(ISolutionSetStats stats)
stats - The summary statistics.IllegalArgumentException - if the argument is nullpublic void setStaticAnalysisStats(StaticAnalysisStats saStats)
saStats - the static analysis stats objectIllegalArgumentException - if the argument is nullpublic Map<Object,Object> getQueryAttributes()
IRunningQuery on the query controller node.null if no query attributes have been
declared.public long getTimestamp()
IEvaluationContextgetTimestamp in interface IEvaluationContextpublic int nextId()
IdFactorypublic boolean isCluster()
IEvaluationContexttrue if we are running on a cluster.isCluster in interface IEvaluationContextpublic boolean isQuads()
IEvaluationContexttrue iff the target AbstractTripleStore is in
quads mode.isQuads in interface IEvaluationContextpublic boolean isSIDs()
IEvaluationContexttrue iff the target AbstractTripleStore is in
SIDS mode.isSIDs in interface IEvaluationContextpublic boolean isTriples()
IEvaluationContexttrue iff the target AbstractTripleStore is in
triples mode.isTriples in interface IEvaluationContextpublic String getNamespace()
IEvaluationContextAbstractTripleStore.getNamespace in interface IEvaluationContextpublic String getSPONamespace()
IEvaluationContextSPORelation.getSPONamespace in interface IEvaluationContextpublic String getLexiconNamespace()
IEvaluationContextLexiconRelation.getLexiconNamespace in interface IEvaluationContextpublic BOpContextBase getBOpContext()
IEvaluationContextIValueExpressions during
query optimization.getBOpContext in interface IEvaluationContextILexiconConfiguration and LexiconRelation for
evaluation if IValueExpressions during query
optimization. (During query evaluation this information is passed
into the pipeline operators by the ContextBindingSet.)BLZG-1372public final String createVar(String prefix)
AST2BOpContext.prefix - The prefix. The general pattern for a prefix is "-foo-".public long getLexiconReadTimestamp()
IEvaluationContextNote: This uses the timestamp of the triple store view unless this is a read/write transaction, in which case we need to use the last commit point in order to see any writes which it may have performed (lexicon writes are always unisolated).
getLexiconReadTimestamp in interface IEvaluationContextpublic AbstractTripleStore getAbstractTripleStore()
IEvaluationContextgetAbstractTripleStore in interface IEvaluationContextpublic ISolutionSetManager getSolutionSetManager()
IEvaluationContextgetSolutionSetManager in interface IEvaluationContextnull.public IDescribeCache getDescribeCache()
IEvaluationContextgetDescribeCache in interface IEvaluationContextnull.QueryHints.DESCRIBE_CACHEpublic DescribeModeEnum getDescribeMode(ProjectionNode projection)
DescribeModeEnum.projection - The query projection.DescribeModeEnumQueryHints.DESCRIBE_MODEpublic int getDescribeIterationLimit(ProjectionNode projection)
projection - The query projection.QueryHints.DESCRIBE_ITERATION_LIMITpublic int getDescribeStatementLimit(ProjectionNode projection)
projection - The query projection.QueryHints.DESCRIBE_STATEMENT_LIMITpublic ISolutionSetStats getSolutionSetStats(String localName)
IEvaluationContextISolutionSetStats.getSolutionSetStats in interface IEvaluationContextISolutionSetStatspublic Set<IVariable<?>> getGloballyScopedVariables()
IEvaluationContextgetGloballyScopedVariables in interface IEvaluationContextpublic void setGloballyScopedVariables(Set<IVariable<?>> globallyScopedVariables)
IEvaluationContextsetGloballyScopedVariables in interface IEvaluationContextCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.