public class ProgramTask extends DataServiceCallable<Object> implements IProgramTask
|Modifier and Type||Field and Description|
|Constructor and Description|
Variant when the task will be executed directly by the caller.
|Modifier and Type||Method and Description|
Execute the program.
Computes the closure of a set of
Run a mutation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ProgramTask(ActionEnum action, IStep step, IJoinNexusFactory joinNexusFactory)
IDataService.submit(Callable)(efficient since all indices will be local, but the indices must not be partitioned and must all exist on the target
Note: the caller MUST submit the
DataService.submit(Callable) in which case
field will be set (after the ctor) by the
DataService itself. The
DataService will be used to identify an
IJoinNexusFactory will be used to establish access to
indices, relations, etc. in the context of the
AbstractTask - see
public ProgramTask(ActionEnum action, IStep step, IJoinNexusFactory joinNexusFactory, IIndexManager indexManager)
IllegalArgumentException- if any parameter is
public void setDataService(DataService dataService)
Note: There is no natural order for high-level query. Also, unless stable
evaluation is requested, the results can be produced by parallel threads
and the order of the materialized solution is therefore not even stable.
The only way to have a natural order is for a sort to be imposed on the
protected IAsynchronousIterator<ISolution> executeQuery(IStep step)
IStepas a query.
IChunkedOrderedIteratorthat will drain the
ISolutions generated by the
IStep. Execution will be cancelled if the iterator is
closed. If execution results in an error, then the iterator will throw a
RuntimeExceptionwhose cause is the error.
protected RuleStats executeMutation(IStep step) throws InterruptedException, ExecutionException
IStepmay consist of many sub-
Note: If you specify
ITx.READ_COMMITTED for mutation operations
when using a federation then concurrent split/join/move can cause the
operation to fail. It is safer to use read-consistent semantics by
protected RuleStats executeClosure(IProgram program) throws InterruptedException, ExecutionException
IRules until the relation(s) on which they are writing reach a "fixed point".
The general approach is a series of rounds in which each rule is applied in turn (either sequentially or in parallel, depending on the program). Solutions computed for each rule in each round written onto the relation for the head of that rule. The process halts when no new solutions are computed in a given round.
Note: When we are running the program on a
each round of the closure is submitted as a single
This allows us to do historical reads during the round and to update the
read-behind timestamp before each round. During the round, the program
will write on buffers that are flushed at the end of the round. Those
buffers will use unisolated writes onto the appropriate relations.
Note: This assumes that you are following the
contract -- you MUST NOT overwrite tuples with the same key and value, or
at least you must not report such "do nothing" overwrites in the mutation
protected RuleStats executeProgramWithEmbeddedClosure(IProgram program) throws InterruptedException, ExecutionException
IProgramcontaining one or more sub-
IProgramthat are closure operations. The top-level program must not be a closure operation. All steps above the closure operations will be run in a sequence. The closure operations themselves will be executed using
Note: Any program that embeds a closure operation must be sequential
(this is enforced by the Program class).
Note: Programs that use closure operations are constrained to either (a)
a fix point of a (normally parallel) program consisting solely of
IRules; or (b) a sequential program containing some steps that
are the fix point of a (normally parallel) program consisting solely of
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.