public class DistributedJoinTask extends JoinTask
DataService hosting that
index partition. Instances are created on the DataService using
the JoinTaskFactoryTask helper class.JoinTask.AccessPathTask, JoinTask.BindingSetConsumerTask, JoinTask.ChunkTask, JoinTask.ThreadLocalFactory<T extends IBuffer<E>,E>| Modifier and Type | Field and Description |
|---|---|
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. |
DEBUG, firstCause, halt, INFO, joinNexus, lastJoin, log, masterProxy, masterUUID, orderIndex, partitionId, predicate, relation, requiredVars, rule, tailCount, tailIndex, WARN| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
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()
|
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. |
call, consumeSources, getTailIndex, halt, reportOnce, toStringprotected 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.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)
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()
protected IBindingSet[] nextChunk() throws InterruptedException
IBindingSets by combining chunks from the
various source JoinTasks.nextChunk in class JoinTaskJoinTasks.InterruptedExceptionprotected 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 JoinTaskprotected 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 JoinTaskprotected 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 JoinTaskCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.