public class DistributedJoinMasterTask extends JoinMasterTask implements Serializable
Note: For query, this object MUST be executed locally on the client. This
ensures that all data flows back to the client directly. For mutation, it
is possible to submit this object to any service in the federation and
each DistributedJoinTask
will write directly on the scale-out
view of the target IMutableRelation
.
DEBUG, joinNexus, joinNexusFactory, joinStats, log, masterUUID, order, rule, ruleState, ruleStats, solutionBuffer, tailCount
Constructor and Description |
---|
DistributedJoinMasterTask(IRule rule,
IJoinNexus joinNexus,
IBuffer<ISolution[]> buffer) |
Modifier and Type | Method and Description |
---|---|
protected List<Future<Void>> |
awaitFactoryFutures(List<Future> factoryTaskFutures)
Await the
JoinTaskFactoryTask Future s. |
IBuffer<ISolution[]> |
getSolutionBuffer()
Returns the buffer specified to the ctor (overridden for distributed
joins).
|
protected List<Future> |
mapBindingSet(IBindingSet bindingSet)
Map the given
IBindingSet over the JoinTask (s) for
the index partition(s) the span the IAccessPath for that
IBindingSet in parallel. |
protected List<Future<Void>> |
start()
Create and run the
JoinTask (s) that will evaluate the first
join dimension. |
awaitAll, call, combineJoinStats, getUUID, newBindingSetIterator, report
public DistributedJoinMasterTask(IRule rule, IJoinNexus joinNexus, IBuffer<ISolution[]> buffer)
rule
- joinNexus
- buffer
- The buffer on which the last DistributedJoinTask
will write query ISolution
s. However, it is
ignored for mutation operations as each
DistributedJoinTask
for the last join dimension
(there can be more than one if the index partition has
more than one partition) will obtain and write on its own
solution buffer in order to avoid moving all data through
the master.UnsupportedOperationException
- unless IJoinNexus.getIndexManager()
reports an
AbstractScaleOutFederation
.public IBuffer<ISolution[]> getSolutionBuffer() throws IOException
JoinMasterTask
getSolutionBuffer
in interface IJoinMaster
getSolutionBuffer
in class JoinMasterTask
IOException
protected final List<Future<Void>> start() throws Exception
JoinTask
(s) that will evaluate the first
join dimension.
A JoinTask
is created on the DataService
for each
index partition that is spanned by the IAccessPath
for the
first IPredicate
in the evaluation order. Those
JoinTask
are run in parallel, so the actual parallelism for
the first IPredicate
is the #of index partitions spanned by
its IAccessPath
.
Future
for each DistributedJoinTask
created for the first join dimension (one per index
partitions spanned by the predicate that is first in the
evaluation order given the initial bindingSet for the rule).Exception
protected List<Future> mapBindingSet(IBindingSet bindingSet) throws Exception
IBindingSet
over the JoinTask
(s) for
the index partition(s) the span the IAccessPath
for that
IBindingSet
in parallel.bindingSet
- The binding set.Future
s for the
JoinTaskFactoryTask
that will create the
DistributedJoinTask
s for the first join dimension.Exception
- FIXME If a predicate defines an IAccessPathExpander
then we DO
NOT map the predicate. Instead, we use
IJoinNexus#getTailAccessPath(IPredicate)
and evaluate the
IAccessPath
with the layered IAccessPathExpander
in
process. If the IAccessPathExpander
touches the index, it will
be using an IClientIndex
. While the IClientIndex
is
not nearly as efficient as using a local index partition, it will
provide a view of the total key-range partitioned index.
do this for each join dimension for which an
IAccessPathExpander
is defined, including not only the first N
join dimensions (handles free text search) but also an intermediate
join dimension (requires that all source join tasks target a join
task having a view of the scale-out index rather than mapping the
task across the index partitions).
FIXME The initial binding set should not be mapped across the index
partitions for the first join dimension if IQueryOptions.isStable()
is true
(any parallel evaluation violates the stable
constraint).
protected List<Future<Void>> awaitFactoryFutures(List<Future> factoryTaskFutures) throws InterruptedException, ExecutionExceptions
JoinTaskFactoryTask
Future
s.
Note: the result for a JoinTaskFactoryTask
Future
is
a DistributedJoinTask
Future
.
factoryTaskFutures
- A list of Future
s, with one Future
for
each index partition that is spanned by the
IAccessPath
for the first IPredicate
in
the evaluation order.DistributedJoinTask
Future
s. There
will be one element in the list for each
JoinTaskFactoryTask
Future
in the caller's
list. The elements will be in the same order.InterruptedException
- if the master itself was interrupted.ExecutionExceptions
- if any of the factory tasks fail.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.