com.bigdata.relation.rule.eval
Class MutationTask
java.lang.Object
com.bigdata.service.FederationCallable<T>
com.bigdata.service.DataServiceCallable<RuleStats>
com.bigdata.relation.rule.eval.AbstractStepTask
com.bigdata.relation.rule.eval.MutationTask
- All Implemented Interfaces:
- IStepTask, IDataServiceCallable, IFederationCallable, Serializable, Cloneable, Callable<RuleStats>
public class MutationTask
- extends AbstractStepTask
A task that executes a mutation operation.
- Version:
- $Id: MutationTask.java 2265 2009-10-26 12:51:06Z thompsonbry $
- Author:
- Bryan Thompson
- See Also:
- Serialized Form
| Methods inherited from class com.bigdata.relation.rule.eval.AbstractStepTask |
clone, getIndexNames, getMutationBuffers, getReadRelations, getWriteRelationNames, getWriteRelations, runOne, runParallel, runSequential, submit, toString |
MutationTask
protected MutationTask(ActionEnum action,
IJoinNexusFactory joinNexusFactory,
IStep step,
IIndexManager indexManager,
DataService dataService)
call
public RuleStats call()
throws Exception
- Run the task.
Note: We can create the individual tasks that we need to execute now that
we are in the correct execution context.
Note: The mutation tasks write on IBuffers and those buffers
flush to indices in the IMutableRelations. We have to defer the
creation of those buffers until we are in the execution context and have
access to the correct indices. In turn, this means that we can not create
the tasks that we are going to execute until we have those buffers on
hand. Hence everything gets deferred until we are in the correct
execution context and have the actual IIndexManager with which
the tasks will execute.
- Throws:
Exception
flushBuffers
protected void flushBuffers(IJoinNexus joinNexus,
Map<String,IBuffer<ISolution[]>> buffers)
throws InterruptedException,
ExecutionException
- Flush the buffer(s) and aggregate the mutation count from each buffer.
This is the actual mutation count for the step(s) executed by the
MutationTask (no double-counting).
- Throws:
InterruptedException
ExecutionException
getMutationCountFromBuffers
protected long getMutationCountFromBuffers(RuleStats totals,
Map<String,IBuffer<ISolution[]>> buffers)
- This just reads off and aggregates the mutationCount from each buffer as
reported by
IBuffer.flush(). This is the actual mutation count
for the step(s) executed by the MutationTask (no
double-counting).
Note: The buffers SHOULD already have been flushed as this does NOT
parallelise the writes on the IMutableRelations. See
#flushBuffers(IJoinNexus, RuleStats, Map), which does
parallelize those writes.
- Returns:
- The mutation count, which was also set as a side-effect on
totals.
newMutationTasks
protected List<Callable<RuleStats>> newMutationTasks(IStep step,
IJoinNexus joinNexus,
Map<String,IBuffer<ISolution[]>> buffers)
- Builds a set of tasks for the program.
- Parameters:
buffers -
- Returns:
Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.