|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.bop.BOpContextBase
com.bigdata.bop.BOpContext<E>
E - The generic type of the objects processed by the operator.public class BOpContext<E>
The evaluation context for the operator (NOT serializable).
| Constructor Summary | |
|---|---|
BOpContext(IRunningQuery runningQuery,
int partitionId,
BOpStats stats,
ICloseableIterator<E[]> source,
IBlockingBuffer<E[]> sink,
IBlockingBuffer<E[]> sink2)
|
|
| Method Summary | |
|---|---|
static IBindingSet |
bind(IBindingSet left,
IBindingSet right,
IConstraint[] constraints,
IVariable[] varsToKeep)
Copy the values for variables from the source IBindingSet to the
destination IBindingSet. |
static boolean |
bind(IPredicate<?> pred,
IConstraint[] constraints,
Object e,
IBindingSet bindings)
Binds variables from a visited element. |
static void |
copyValues(IElement e,
IPredicate<?> pred,
IBindingSet bindingSet)
Copy the values for variables in the predicate from the element, applying them to the caller's IBindingSet. |
ClientConnectionManager |
getClientConnectionManager()
Return the ClientConnectionManager used to make remote SERVICE
call requests. |
IMemoryManager |
getMemoryManager(UUID queryId)
Return the IMemoryManager associated with the specified query. |
int |
getPartitionId()
The index partition identifier -or- -1 if the index is not
sharded. |
IQueryAttributes |
getQueryAttributes()
Return the IQueryAttributes associated with this query. |
IQueryAttributes |
getQueryAttributes(UUID queryId)
Return the IQueryAttributes associated with the specified query. |
IRunningQuery |
getRunningQuery()
The interface for a running query. |
IRunningQuery |
getRunningQuery(UUID queryId)
Return the IRunningQuery associated with the specified queryId. |
IBlockingBuffer<E[]> |
getSink()
Where to write the output of the operator. |
IBlockingBuffer<E[]> |
getSink2()
Optional alternative sink for the output of the operator. |
ICloseableIterator<E[]> |
getSource()
Where to read the data to be consumed by the operator. |
BOpStats |
getStats()
The object used to collect statistics about the evaluation of this operator. |
boolean |
isLastInvocation()
true iff this is the last invocation of the operator. |
void |
setLastInvocation()
Set by the QueryEngine when the criteria specified by
isLastInvocation() are satisfied. |
static ICloseableIterator<IBindingSet> |
solutions(IChunkedIterator<?> src,
IPredicate<?> pred,
BaseJoinStats stats)
Convert an IAccessPath.iterator() into a stream of
IBindingSets. |
| Methods inherited from class com.bigdata.bop.BOpContextBase |
|---|
getAccessPath, getExecutorService, getFederation, getIndexManager, getRelation, getResource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BOpContext(IRunningQuery runningQuery,
int partitionId,
BOpStats stats,
ICloseableIterator<E[]> source,
IBlockingBuffer<E[]> sink,
IBlockingBuffer<E[]> sink2)
runningQuery - The IRunningQuery.partitionId - The index partition identifier -or- -1 if the
index is not sharded.stats - The object used to collect statistics about the evaluation of
this operator.source - Where to read the data to be consumed by the operator.sink - Where to write the output of the operator.sink2 - Alternative sink for the output of the operator (optional).
This is used by things like SPARQL optional joins to route
failed joins outside of the join group.
IllegalArgumentException - if the stats is null
IllegalArgumentException - if the source is null (use an empty
source if the source will be ignored).
IllegalArgumentException - if the sink is nullIChunkMessage or an interface available
from getChunk() on IChunkMessage which provides us with
flexible mechanisms for accessing the chunk data.
When doing that, modify to automatically track the BOpStats
as the source is consumed.
Note: The only call to this method outside of the test suite is from ChunkedRunningQuery. It always has a fully materialized chunk on hand and ready to be processed.
| Method Detail |
|---|
public void setLastInvocation()
QueryEngine when the criteria specified by
isLastInvocation() are satisfied.
public boolean isLastInvocation()
true iff this is the last invocation of the operator. The
property is only set to true for operators which:
PipelineOp.Annotations.LAST_PASS is truePipelineOp.Annotations.PIPELINED is truePipelineOp.Annotations.MAX_PARALLEL is 1IQueryClient to
atomically decide that a specific invocation of the operator task for the
query will be the last invocation for that task. This is not possible if
the operator allows concurrent evaluation tasks. Sharded operators are
intrinsically concurrent since they can evaluate at each shard in
parallel. This is why the evaluation context is locked to the query
controller. In addition, the operator must declare that it is NOT thread
safe in order for the query engine to serialize its evaluation tasks.
public IRunningQuery getRunningQuery()
Note: In scale-out each node will have a distinct IRunningQuery
object and the query controller will have access to additional state,
such as the aggregation of the BOpStats for the query on all
nodes.
public final int getPartitionId()
-1 if the index is not
sharded.
public final BOpStats getStats()
public final ICloseableIterator<E[]> getSource()
public final IBlockingBuffer<E[]> getSink()
PipelineOp.Annotations.SINK_REFpublic final IBlockingBuffer<E[]> getSink2()
PipelineOp.Annotations.ALT_SINK_REF,
PipelineOp.Annotations#ALT_SINK_GROUPpublic IRunningQuery getRunningQuery(UUID queryId)
IRunningQuery associated with the specified queryId.
queryId - The UUID of some IRunningQuery.
IRunningQuery.
RuntimeException - if the IRunningQuery has halted.
RuntimeException - if the IRunningQuery is not found.public IQueryAttributes getQueryAttributes(UUID queryId)
IQueryAttributes associated with the specified query.
queryId - The UUID of some IRunningQuery.
IQueryAttributes for that IRunningQuery.
RuntimeException - if the IRunningQuery has halted.
RuntimeException - if the IRunningQuery is not found.public IQueryAttributes getQueryAttributes()
IQueryAttributes associated with this query.
IQueryAttributes.public IMemoryManager getMemoryManager(UUID queryId)
IMemoryManager associated with the specified query.
queryId - The UUID of some IRunningQuery.
IMemoryManager for that IRunningQuery.
RuntimeException - if the IRunningQuery has halted.
RuntimeException - if the IRunningQuery is not found.public ClientConnectionManager getClientConnectionManager()
ClientConnectionManager used to make remote SERVICE
call requests.
public static final boolean bind(IPredicate<?> pred,
IConstraint[] constraints,
Object e,
IBindingSet bindings)
Note: The bindings are propagated before the constraints are verified so this method will have a side-effect on the bindings even if the constraints were not satisfied. Therefore you should clone the bindings before calling this method.
pred - The IPredicate from which the element was read.constraint - A constraint which must be satisfied (optional).e - An element materialized by the IAccessPath for that
IPredicate.bindingSet - the bindings to which new bindings from the element will be
applied.
true unless the new bindings would violate any of
the optional IConstraint.
NullPointerException - if an argument is null.
public static void copyValues(IElement e,
IPredicate<?> pred,
IBindingSet bindingSet)
IBindingSet.
Note: A variable which is bound outside of the query to a constant gets
turned into a Constant with that variable as its annotation. This
method causes the binding to be created for the variable and the constant
when the constant is JOINed.
e - The element.pred - The predicate.bindingSet - The binding set, which is modified as a side-effect.
TODO Make this method package private once we convert to using
an inline access path.
public static IBindingSet bind(IBindingSet left,
IBindingSet right,
IConstraint[] constraints,
IVariable[] varsToKeep)
IBindingSet to the
destination IBindingSet. It is an error if a binding already
exists in the destination IBindingSet which is not consistent
with a binding in the source IBindingSet.
left - The left binding set.right - The right binding set.constraints - An array of constraints (optional). When given, destination
IBindingSet will be validated after mutation.varsToKeep - An array of variables whose bindings will be retained. The
bindings are not stripped out until after the constraint(s)
(if any) have been tested.
null if
the bindings were not consistent, if a constraint was violated,
etc.
public static ICloseableIterator<IBindingSet> solutions(IChunkedIterator<?> src,
IPredicate<?> pred,
BaseJoinStats stats)
IAccessPath.iterator() into a stream of
IBindingSets.
src - The iterator draining the IAccessPath. This will visit
IElements.pred - The predicate for that IAccessPathstats - Statistics to be updated as elements and chunks are consumed
(optional).
IElements is preserved.(AccessPath
should visit binding sets rather than elements when used for high
level query.),
(Inline access
path).
TODO Move to {@link IAccessPath}? {@link AccessPath}?
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||