|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.relation.rule.eval.pipeline.JoinTask
com.bigdata.relation.rule.eval.pipeline.DistributedJoinTask
public class DistributedJoinTask
Implementation used by scale-out deployments. There will be one instance
of this task per index partition on which the rule will read. Those
instances will be in-process on the DataService hosting that
index partition. Instances are created on the DataService using
the JoinTaskFactoryTask helper class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.bigdata.relation.rule.eval.pipeline.JoinTask |
|---|
JoinTask.AccessPathTask, JoinTask.BindingSetConsumerTask, JoinTask.ChunkTask, JoinTask.ThreadLocalFactory<T extends IBuffer<E>,E> |
| Field Summary | |
|---|---|
protected AbstractScaleOutFederation<?> |
fed
The federation is used to obtain locator scans for the access paths. |
protected IJoinNexus |
fedJoinNexus
The IJoinNexus for the IBigdataFederation. |
protected Future<Void> |
futureProxy
A (proxy for) the Future for this DistributedJoinTask. |
| Fields inherited from class com.bigdata.relation.rule.eval.pipeline.JoinTask |
|---|
DEBUG, firstCause, halt, INFO, joinNexus, lastJoin, log, masterProxy, masterUUID, orderIndex, partitionId, predicate, relation, requiredVars, rule, tailCount, tailIndex, WARN |
| Constructor Summary | |
|---|---|
DistributedJoinTask(IRule rule,
IJoinNexus joinNexus,
int[] order,
int orderIndex,
int partitionId,
AbstractScaleOutFederation<?> fed,
IJoinMaster master,
UUID masterUUID,
IAsynchronousIterator<IBindingSet[]> src,
IKeyOrder[] keyOrders,
DataService dataService,
IVariable[][] requiredVars)
|
|
| Method Summary | |
|---|---|
boolean |
addSource(IAsynchronousIterator<IBindingSet[]> source)
Adds a source from which this DistributedJoinTask will read
IBindingSet chunks. |
protected void |
cancelSinks()
Cancel all DistributedJoinTasks that are sinks for this
DistributedJoinTask. |
protected void |
closeSources()
Sets a flag preventing new sources from being declared and closes all known sources and removes this task from the Session. |
protected IBindingSet[] |
combineChunks(List<IBindingSet[]> chunks,
int bindingSetCount)
Combine the chunk(s) into a single chunk. |
protected void |
flushAndCloseBuffersAndAwaitSinks()
Notifies each sink that this DistributedJoinTask will no
longer generate new IBindingSet chunks and then waits for the
sink task(s) to complete. |
protected JoinTaskSink |
getSink(PartitionLocator locator)
Return the sink on which we will write IBindingSet for the
index partition associated with the specified locator. |
protected IBuffer<ISolution[]> |
getSolutionBuffer()
The buffer on which the last predicate in the evaluation order will write its ISolutions. |
protected void |
logCallError(Throwable t)
Logs an error in JoinTask.call() on the local log file and adds
some metadata about the operation which was being executed. |
protected AbstractUnsynchronizedArrayBuffer<IBindingSet> |
newUnsyncOutputBuffer()
A method used by the JoinTask.threadLocalBufferFactory to create new
output buffer as required. |
protected IBindingSet[] |
nextChunk()
Returns a chunk of IBindingSets by combining chunks from the
various source JoinTasks. |
| Methods inherited from class com.bigdata.relation.rule.eval.pipeline.JoinTask |
|---|
call, consumeSources, getTailIndex, halt, reportOnce, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final AbstractScaleOutFederation<?> fed
protected final IJoinNexus fedJoinNexus
IJoinNexus for the IBigdataFederation. This is
mainly used to setup the solutionBuffer since it needs to
write on the scale-out index while the AccessPathTask will
read on the local index partition view.
protected Future<Void> futureProxy
Future for this DistributedJoinTask.
| Constructor Detail |
|---|
public DistributedJoinTask(IRule rule,
IJoinNexus joinNexus,
int[] order,
int orderIndex,
int partitionId,
AbstractScaleOutFederation<?> fed,
IJoinMaster master,
UUID masterUUID,
IAsynchronousIterator<IBindingSet[]> src,
IKeyOrder[] keyOrders,
DataService dataService,
IVariable[][] requiredVars)
| Method Detail |
|---|
public boolean addSource(IAsynchronousIterator<IBindingSet[]> source)
DistributedJoinTask will read
IBindingSet chunks.
source - The source.
true iff the source was accepted.
IllegalArgumentException - if the source is null.protected final IBuffer<ISolution[]> getSolutionBuffer()
JoinTaskISolutions.
getSolutionBuffer in class JoinTaskprotected void closeSources()
sources and removes this task from the Session.
protected IBindingSet[] nextChunk()
throws InterruptedException
IBindingSets by combining chunks from the
various source JoinTasks.
nextChunk in class JoinTaskJoinTasks.
InterruptedException
protected IBindingSet[] combineChunks(List<IBindingSet[]> chunks,
int bindingSetCount)
chunks - A list of chunks read from the sources.bindingSetCount - The #of bindingSets in those chunks.
protected AbstractUnsynchronizedArrayBuffer<IBindingSet> newUnsyncOutputBuffer()
JoinTaskJoinTask.threadLocalBufferFactory to create new
output buffer as required. The output buffer will be used to
aggregate IBindingSets generated by this JoinTask.
Note: A different implementation class must be used depending on
whether or not this is the last join dimension for the query (when it
is, then we write on the solution buffer) and whether or not the
target join index is key-range partitioned (when it is, each binding
set is mapped across the sink JoinTask(s)).
newUnsyncOutputBuffer in class JoinTask
protected void flushAndCloseBuffersAndAwaitSinks()
throws InterruptedException,
ExecutionException
DistributedJoinTask will no
longer generate new IBindingSet chunks and then waits for the
sink task(s) to complete.
Note: Closing the BlockingBuffer from which a sink
JoinTask is reading will cause the source iterator for that
sink task to eventually return false indicating that
it is exhausted (assuming that the sink keeps reading on the
iterator).
flushAndCloseBuffersAndAwaitSinks in class JoinTaskInterruptedException - if interrupted while awaiting the future for a sink.
ExecutionExceptionprotected void cancelSinks()
DistributedJoinTasks that are sinks for this
DistributedJoinTask.
cancelSinks in class JoinTask
protected JoinTaskSink getSink(PartitionLocator locator)
throws InterruptedException,
RuntimeException
IBindingSet for the
index partition associated with the specified locator. The sink will
be backed by a DistributedJoinTask running on the
IDataService that is host to that index partition. The
scale-out index will be the scale-out index for the next
IPredicate in the evaluation order.
locator - The locator for the index partition.
RuntimeException - If the JoinTaskFactoryTask fails.
InterruptedException - If the JoinTaskFactoryTask is interrupted.protected void logCallError(Throwable t)
JoinTask.call() on the local log file and adds
some metadata about the operation which was being executed. This does not
imply that the error originates with this join task. You have to inspect
the error messages, the order in which the joins were being evaluated,
and even correlate the JoinTask.masterUUID in order to figure out
what really happened.
logCallError in class JoinTask
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||