@ThreadSafe public class QueryContext extends Object
The only mutable state on this context is whether the query has been cancelled
.
Modifier and Type | Field and Description |
---|---|
protected BufferManager |
bufferManager |
protected ExecutionContext |
context |
protected PlanHints |
hints |
protected RepositoryIndexes |
indexDefns |
protected NodeTypes |
nodeTypes |
protected Map<String,NodeCache> |
overriddenNodeCachesByWorkspaceName |
protected Problems |
problems |
protected static AtomicLong |
QUERY_COUNTER |
protected RepositoryCache |
repositoryCache |
protected Schemata |
schemata |
protected TypeSystem |
typeSystem |
protected Map<String,Object> |
variables |
protected Set<String> |
workspaceNames |
Modifier | Constructor and Description |
---|---|
|
QueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager,
PlanHints hints,
Problems problems,
Map<String,Object> variables)
Create a new context for query execution.
|
protected |
QueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager,
PlanHints hints,
Problems problems,
Map<String,Object> variables,
long id)
Create a new context for query execution.
|
|
QueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager)
Create a new context for query execution.
|
|
QueryContext(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Schemata schemata,
RepositoryIndexes indexDefns,
NodeTypes nodeTypes,
BufferManager bufferManager,
PlanHints hints,
Problems problems)
Create a new context for query execution.
|
protected |
QueryContext(QueryContext original)
Create a new context that is a copy of the supplied context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancel the query if it is currently running.
|
boolean |
equals(Object obj) |
BufferManager |
getBufferManager() |
ExecutionContext |
getExecutionContext()
Get the execution context in which the query is to be evaluated
|
PlanHints |
getHints()
Get the plan hints.
|
RepositoryIndexes |
getIndexDefinitions()
Get the current index definitions.
|
NamespaceRegistry |
getNamespaceRegistry()
Get the namespace registry with durable prefixes as used by the query indexes.
|
NodeCache |
getNodeCache(String workspaceName)
Get the NodeCache for the given workspace name.
|
NodeTypes |
getNodeTypes()
Get an immutable snapshot of the node types.
|
Problems |
getProblems()
Get the problem container used by this query context.
|
RepositoryCache |
getRepositoryCache()
Get the RepositoryCache instance that should be used to load the result tuple values.
|
Schemata |
getSchemata()
Get the definition of the tables available within this query context.
|
TypeSystem |
getTypeSystem()
Get the interface for working with literal values and types.
|
Map<String,Object> |
getVariables()
Get the variables that are to be substituted into the
BindVariableName used in the query. |
Set<String> |
getWorkspaceNames()
Get the names of each workspace that is to be queried.
|
int |
hashCode() |
long |
id()
Get the local identifier used within the query engine to identify a query context.
|
boolean |
isCancelled() |
QueryContext |
with(Map<String,Object> variables)
Obtain a copy of this context, except that the copy uses the supplied variables.
|
QueryContext |
with(PlanHints hints)
Obtain a copy of this context, except that the copy uses the supplied hints.
|
QueryContext |
with(Problems problems)
Obtain a copy of this context, except that the copy uses the supplied problem container.
|
QueryContext |
with(Schemata schemata)
Obtain a copy of this context, except that the copy uses the supplied schemata.
|
protected static final AtomicLong QUERY_COUNTER
protected final ExecutionContext context
protected final RepositoryCache repositoryCache
protected final TypeSystem typeSystem
protected final PlanHints hints
protected final NodeTypes nodeTypes
protected final Schemata schemata
protected final RepositoryIndexes indexDefns
protected final Problems problems
protected final Map<String,NodeCache> overriddenNodeCachesByWorkspaceName
protected final BufferManager bufferManager
protected QueryContext(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Map<String,NodeCache> overriddenNodeCachesByWorkspaceName, Schemata schemata, RepositoryIndexes indexDefns, NodeTypes nodeTypes, BufferManager bufferManager, PlanHints hints, Problems problems, Map<String,Object> variables, long id)
context
- the context in which the query is being executed; may not be nullrepositoryCache
- the repository cache that should be used to load results; may be null if no results are to be loadedworkspaceNames
- the name of each workspace to be queried, or an empty set if all the workspaces should be queried;
may not be nulloverriddenNodeCachesByWorkspaceName
- the NodeCache instances that should be used to load results, which will be used
instead of the RepositoryCache's NodeCache for a given workspace name; may be null or emptyschemata
- the schemataindexDefns
- the definitions for the currently-defined indexes; never nullnodeTypes
- the snapshot of the node types; may not be nullbufferManager
- the buffer manager; may not be nullhints
- the hints, or null if there are no hintsproblems
- the problems container, or null if a new problems container should be createdvariables
- the mapping of variables and values, or null if there are no such variablesid
- the identifier for this query contextIllegalArgumentException
- if the context, workspace name, or schemata are nullpublic QueryContext(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Map<String,NodeCache> overriddenNodeCachesByWorkspaceName, Schemata schemata, RepositoryIndexes indexDefns, NodeTypes nodeTypes, BufferManager bufferManager, PlanHints hints, Problems problems, Map<String,Object> variables)
context
- the context in which the query is being executed; may not be nullrepositoryCache
- the repository cache that should be used to load results; may be null if no results are to be loadedworkspaceNames
- the name of each workspace to be queried, or an empty set if all the workspaces should be queried;
may not be nulloverriddenNodeCachesByWorkspaceName
- the NodeCache instances that should be used to load results, which will be used
instead of the RepositoryCache's NodeCache for a given workspace name; may be null or emptyschemata
- the schemataindexDefns
- the definitions for the currently-defined indexes; never nullnodeTypes
- the snapshot of the node types; may not be nullbufferManager
- the buffer manager; may not be nullhints
- the hints, or null if there are no hintsproblems
- the problems container, or null if a new problems container should be createdvariables
- the mapping of variables and values, or null if there are no such variablesIllegalArgumentException
- if the context, workspace name, or schemata are nullpublic QueryContext(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Schemata schemata, RepositoryIndexes indexDefns, NodeTypes nodeTypes, BufferManager bufferManager, PlanHints hints, Problems problems)
context
- the context in which the query is being executed; may not be nullrepositoryCache
- the repository cache that should be used to load results; may not be nullworkspaceNames
- the name of each workspace to be queried, or an empty set if all the workspaces should be queried;
may not be nullschemata
- the schemataindexDefns
- the definitions for the currently-defined indexes; never nullnodeTypes
- the snapshot of the node types; may not be nullbufferManager
- the buffer manager; may not be nullhints
- the hints, or null if there are no hintsproblems
- the problems container, or null if a new problems container should be createdIllegalArgumentException
- if the context, workspace name, or schemata are nullpublic QueryContext(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Schemata schemata, RepositoryIndexes indexDefns, NodeTypes nodeTypes, BufferManager bufferManager)
context
- the context in which the query is being executed; may not be nullrepositoryCache
- the repository cache that should be used to load results; may not be nullworkspaceNames
- the name of each workspace to be queried, or an empty set if all the workspaces should be queried;
may not be nullschemata
- the schemataindexDefns
- the definitions for the currently-defined indexes; never nullnodeTypes
- the snapshot of the node types; may not be nullbufferManager
- the buffer manager; may not be nullIllegalArgumentException
- if the context, workspace name, or schemata are nullprotected QueryContext(QueryContext original)
original
- the original contextIllegalArgumentException
- if the original is nullpublic final boolean cancel()
public final boolean isCancelled()
public final long id()
public NodeCache getNodeCache(String workspaceName) throws WorkspaceNotFoundException
workspaceName
- the name of the workspaceWorkspaceNotFoundException
- if there is no workspace with the supplied namepublic NamespaceRegistry getNamespaceRegistry()
public RepositoryCache getRepositoryCache()
public RepositoryIndexes getIndexDefinitions()
public ExecutionContext getExecutionContext()
public Set<String> getWorkspaceNames()
public TypeSystem getTypeSystem()
public final PlanHints getHints()
public final Problems getProblems()
public Schemata getSchemata()
public NodeTypes getNodeTypes()
public BufferManager getBufferManager()
public Map<String,Object> getVariables()
BindVariableName
used in the query.public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public QueryContext with(Schemata schemata)
schemata
- the schemata that should be used in the new contextIllegalArgumentException
- if the schemata reference is nullpublic QueryContext with(PlanHints hints)
hints
- the hints that should be used in the new contextIllegalArgumentException
- if the hints reference is nullpublic QueryContext with(Problems problems)
problems
- the problems that should be used in the new context; may be null if a new problem container should be usedpublic QueryContext with(Map<String,Object> variables)
variables
- the variables that should be used in the new context; may be null if there are no such variablesCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.