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
AST2BOpJoins s. |
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
IValueExpression s 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 queryHints
s 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
PipelineOp
s generated from that AST node.
public final UUID queryId
QueryHints.QUERYID
,
QueryEngine.Annotations#QUERY_ID
public final ASTOptimizerList optimizers
public final BOpContextBase context
AST2BOpJoins
s.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_SOLUTIONS
public 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_JOINS
public 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_JOIN
public 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
,
JVMSolutionSetHashJoinOp
public 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()
IEvaluationContext
AST2BOpUtility.convert(AST2BOpContext, IBindingSet[])
before it begins to run the IASTOptimizer
s.getSolutionSetStats
in interface IEvaluationContext
public StaticAnalysisStats getStaticAnalysisStats()
IEvaluationContext
getStaticAnalysisStats
in interface IEvaluationContext
public void setSolutionSetStats(ISolutionSetStats stats)
stats
- The summary statistics.IllegalArgumentException
- if the argument is null
public void setStaticAnalysisStats(StaticAnalysisStats saStats)
saStats
- the static analysis stats objectIllegalArgumentException
- if the argument is null
public Map<Object,Object> getQueryAttributes()
IRunningQuery
on the query controller node.null
if no query attributes have been
declared.public long getTimestamp()
IEvaluationContext
getTimestamp
in interface IEvaluationContext
public int nextId()
IdFactory
public boolean isCluster()
IEvaluationContext
true
if we are running on a cluster.isCluster
in interface IEvaluationContext
public boolean isQuads()
IEvaluationContext
true
iff the target AbstractTripleStore
is in
quads mode.isQuads
in interface IEvaluationContext
public boolean isSIDs()
IEvaluationContext
true
iff the target AbstractTripleStore
is in
SIDS mode.isSIDs
in interface IEvaluationContext
public boolean isTriples()
IEvaluationContext
true
iff the target AbstractTripleStore
is in
triples mode.isTriples
in interface IEvaluationContext
public String getNamespace()
IEvaluationContext
AbstractTripleStore
.getNamespace
in interface IEvaluationContext
public String getSPONamespace()
IEvaluationContext
SPORelation
.getSPONamespace
in interface IEvaluationContext
public String getLexiconNamespace()
IEvaluationContext
LexiconRelation
.getLexiconNamespace
in interface IEvaluationContext
public BOpContextBase getBOpContext()
IEvaluationContext
IValueExpression
s during
query optimization.getBOpContext
in interface IEvaluationContext
ILexiconConfiguration
and LexiconRelation
for
evaluation if IValueExpression
s during query
optimization. (During query evaluation this information is passed
into the pipeline operators by the ContextBindingSet
.)BLZG-1372
public final String createVar(String prefix)
AST2BOpContext
.prefix
- The prefix. The general pattern for a prefix is "-foo-".public long getLexiconReadTimestamp()
IEvaluationContext
Note: 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 IEvaluationContext
public AbstractTripleStore getAbstractTripleStore()
IEvaluationContext
getAbstractTripleStore
in interface IEvaluationContext
public ISolutionSetManager getSolutionSetManager()
IEvaluationContext
getSolutionSetManager
in interface IEvaluationContext
null
.public IDescribeCache getDescribeCache()
IEvaluationContext
getDescribeCache
in interface IEvaluationContext
null
.QueryHints.DESCRIBE_CACHE
public DescribeModeEnum getDescribeMode(ProjectionNode projection)
DescribeModeEnum
.projection
- The query projection.DescribeModeEnum
QueryHints.DESCRIBE_MODE
public int getDescribeIterationLimit(ProjectionNode projection)
projection
- The query projection.QueryHints.DESCRIBE_ITERATION_LIMIT
public int getDescribeStatementLimit(ProjectionNode projection)
projection
- The query projection.QueryHints.DESCRIBE_STATEMENT_LIMIT
public ISolutionSetStats getSolutionSetStats(String localName)
IEvaluationContext
ISolutionSetStats
.getSolutionSetStats
in interface IEvaluationContext
ISolutionSetStats
public Set<IVariable<?>> getGloballyScopedVariables()
IEvaluationContext
getGloballyScopedVariables
in interface IEvaluationContext
public void setGloballyScopedVariables(Set<IVariable<?>> globallyScopedVariables)
IEvaluationContext
setGloballyScopedVariables
in interface IEvaluationContext
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.