public class LocalJoinTask extends JoinTask
JoinTask.AccessPathTask, JoinTask.BindingSetConsumerTask, JoinTask.ChunkTask, JoinTask.ThreadLocalFactory<T extends IBuffer<E>,E>
Modifier and Type | Field and Description |
---|---|
protected BlockingBuffer<IBindingSet[]> |
syncBuffer
The
BlockingBuffer whose queue will be drained by the
downstream LocalJoinTask -or- null IFF
[lastJoin == true]. |
DEBUG, firstCause, halt, INFO, joinNexus, lastJoin, log, masterProxy, masterUUID, orderIndex, partitionId, predicate, relation, requiredVars, rule, tailCount, tailIndex, WARN
Constructor and Description |
---|
LocalJoinTask(IRule rule,
IJoinNexus joinNexus,
int[] order,
int orderIndex,
IJoinMaster masterProxy,
UUID masterUUID,
IAsynchronousIterator<IBindingSet[]> source,
IBuffer<ISolution[]> solutionBuffer,
IVariable[][] requiredVars) |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelSinks()
Cancel sink
JoinTask (s). |
protected void |
closeSources()
Closes the
source specified to the ctor. |
protected void |
flushAndCloseBuffersAndAwaitSinks()
Flush and close all output buffers and await sink
JoinTask (s). |
protected IBuffer<ISolution[]> |
getSolutionBuffer()
The buffer on which the last predicate in the evaluation order will
write its
ISolution s. |
protected AbstractUnsynchronizedArrayBuffer<IBindingSet> |
newUnsyncOutputBuffer()
Note: The target buffer on which the unsynchronized buffer writes
depends on whether or not there is a downstream sink for this
LocalJoinTask . |
protected IBindingSet[] |
nextChunk()
Return the next chunk of
IBindingSet s the source
JoinTask . |
protected void |
setSinkFuture(Future<? extends Object> f)
Set the future for the downstream join dimension on this join task.
|
call, consumeSources, getTailIndex, halt, logCallError, reportOnce, toString
protected final BlockingBuffer<IBindingSet[]> syncBuffer
BlockingBuffer
whose queue will be drained by the
downstream LocalJoinTask
-or- null
IFF
[lastJoin == true].public LocalJoinTask(IRule rule, IJoinNexus joinNexus, int[] order, int orderIndex, IJoinMaster masterProxy, UUID masterUUID, IAsynchronousIterator<IBindingSet[]> source, IBuffer<ISolution[]> solutionBuffer, IVariable[][] requiredVars)
rule
- joinNexusFactory
- order
- orderIndex
- masterProxy
- masterUUID
- source
- solutionBuffer
- ruleState
- protected IBuffer<ISolution[]> getSolutionBuffer()
JoinTask
ISolution
s.getSolutionBuffer
in class JoinTask
protected void closeSources()
source
specified to the ctor.protected final AbstractUnsynchronizedArrayBuffer<IBindingSet> newUnsyncOutputBuffer()
LocalJoinTask
. When this is the JoinTask.lastJoin
,
the unsynchronized buffer returned by this method will write on the
solution buffer. Otherwise it will write on syncBuffer
,
which is drained by the sink LocalJoinTask
.newUnsyncOutputBuffer
in class JoinTask
protected final void setSinkFuture(Future<? extends Object> f)
flushAndCloseBuffersAndAwaitSinks()
and
cancelSinks()
, both of which are executed from JoinTask.call()
.f
- The future for the downstream join dimension.IllegalStateException
- if the future was already set.IllegalArgumentException
- if the argument is null
.protected void flushAndCloseBuffersAndAwaitSinks() throws InterruptedException, ExecutionException
JoinTask
JoinTask
(s).
Note: You MUST close the BlockingBuffer
from which each sink
reads before invoking this method in order for those sinks to
terminate. Otherwise the source IAsynchronousIterator
(s) on which
the sink is reading will remain open and the sink will never decide that
it has exhausted its source(s).
flushAndCloseBuffersAndAwaitSinks
in class JoinTask
InterruptedException
ExecutionException
protected void cancelSinks()
JoinTask
JoinTask
(s).cancelSinks
in class JoinTask
protected IBindingSet[] nextChunk() throws InterruptedException
IBindingSet
s the source
JoinTask
.nextChunk
in class JoinTask
null
iff the source is
exhausted.InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.