com.bigdata.relation.rule.eval
Class QueryTask

java.lang.Object
  extended by com.bigdata.service.FederationCallable<T>
      extended by com.bigdata.service.DataServiceCallable<RuleStats>
          extended by com.bigdata.relation.rule.eval.AbstractStepTask
              extended by com.bigdata.relation.rule.eval.QueryTask
All Implemented Interfaces:
IStepTask, IDataServiceCallable, IFederationCallable, Serializable, Cloneable, Callable<RuleStats>

public class QueryTask
extends AbstractStepTask

A task that executes a query operation.

Version:
$Id: QueryTask.java 3041 2010-06-18 15:41:10Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.bigdata.relation.rule.eval.AbstractStepTask
action, indexManager, joinNexusFactory, log, step
 
Constructor Summary
QueryTask(IStep step, IJoinNexusFactory joinNexusFactory, IBlockingBuffer<ISolution[]> buffer, IIndexManager indexManager, DataService dataService)
           
 
Method Summary
 RuleStats call()
          Run the task (invoked once we are in the target execution context).
protected  List<Callable<RuleStats>> newQueryTasks(IStep step, IJoinNexus joinNexus, IBlockingBuffer<ISolution[]> buffer)
          Builds a set of tasks for the program.
protected  RuleStats runTasks(IJoinNexus joinNexus, List<Callable<RuleStats>> tasks)
          Run the task(s) and wait for them to complete.
 
Methods inherited from class com.bigdata.relation.rule.eval.AbstractStepTask
clone, getIndexNames, getMutationBuffers, getReadRelations, getWriteRelationNames, getWriteRelations, runOne, runParallel, runSequential, submit, toString
 
Methods inherited from class com.bigdata.service.DataServiceCallable
getDataService, isDataService, setDataService
 
Methods inherited from class com.bigdata.service.FederationCallable
getFederation, setFederation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bigdata.service.IFederationCallable
getFederation, setFederation
 

Constructor Detail

QueryTask

public QueryTask(IStep step,
                 IJoinNexusFactory joinNexusFactory,
                 IBlockingBuffer<ISolution[]> buffer,
                 IIndexManager indexManager,
                 DataService dataService)
Parameters:
buffer - The IBlockingBuffer on which the ISolutions will be written.
Method Detail

call

public RuleStats call()
               throws Exception
Run the task (invoked once we are in the target execution context).

Throws:
Exception

runTasks

protected RuleStats runTasks(IJoinNexus joinNexus,
                             List<Callable<RuleStats>> tasks)
                      throws InterruptedException,
                             ExecutionException
Run the task(s) and wait for them to complete.

Returns:
The RuleStats
Throws:
ExecutionException
InterruptedException

newQueryTasks

protected List<Callable<RuleStats>> newQueryTasks(IStep step,
                                                  IJoinNexus joinNexus,
                                                  IBlockingBuffer<ISolution[]> buffer)
Builds a set of tasks for the program. Each task is assigned its own UnsynchronizedArrayBuffer. Each task will flush that UnsynchronizedArrayBuffer onto the given IBuffer when it completes.

Parameters:
step - The IStep.
joinNexus - The IJoinNexus.
buffer - The thread-safe buffer onto which the individual tasks emit chunks.
Returns:
The list of tasks to run.


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.