public class TaskStreamingInstance extends java.lang.Object implements INodeInstance, ISync
Modifier and Type | Field and Description |
---|---|
protected Config |
config
The configuration
|
protected int |
globalTaskId
The globally unique task id
|
protected int |
highWaterMark
The high water mark for messages
|
protected java.util.Map<java.lang.String,IParallelOperation> |
inParOps
Inward parallel operations
|
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
inputEdges
Input edges
|
protected java.util.concurrent.BlockingQueue<IMessage> |
inQueue
All the inputs will come through a single queue, otherwise we need to look
at different queues for messages
|
protected int |
lowWaterMark
The low watermark for queued messages
|
protected java.util.Map<java.lang.String,java.lang.Object> |
nodeConfigs
Node configurations
|
protected java.util.Map<java.lang.String,IParallelOperation> |
outParOps
Parallel operations
|
protected OutputCollection |
outputCollection
The output collection to be used
|
protected java.util.Map<java.lang.String,java.lang.String> |
outputEdges
Output edges
|
protected java.util.concurrent.BlockingQueue<IMessage> |
outQueue
Output will go throuh a single queue
|
protected int |
parallelism
Number of parallel tasks
|
protected ICompute |
task
The actual task executing
|
protected int |
taskId
The task id
|
protected int |
taskIndex
Task index that goes from 0 to parallism - 1
|
protected java.lang.String |
taskName
Name of the task
|
protected TaskSchedulePlan |
taskSchedule |
protected int |
workerId
The worker id
|
Constructor and Description |
---|
TaskStreamingInstance(ICompute task,
java.util.concurrent.BlockingQueue<IMessage> inQueue,
java.util.concurrent.BlockingQueue<IMessage> outQueue,
Config config,
java.lang.String tName,
int taskId,
int globalTaskId,
int tIndex,
int parallel,
int wId,
java.util.Map<java.lang.String,java.lang.Object> cfgs,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inEdges,
java.util.Map<java.lang.String,java.lang.String> outEdges,
TaskSchedulePlan taskSchedule,
CheckpointingClient checkpointingClient,
java.lang.String taskGraphName,
long tasksVersion) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls at the end to clean up
|
boolean |
execute()
Executing compute task
|
int |
getIndex() |
java.util.concurrent.BlockingQueue<IMessage> |
getInQueue() |
INode |
getNode()
Get the node of this instance
|
void |
prepare(Config cfg)
Preparing the task
|
void |
registerInParallelOperation(java.lang.String edge,
IParallelOperation op) |
void |
registerOutParallelOperation(java.lang.String edge,
IParallelOperation op) |
void |
scheduleBarriers(java.lang.Long bid) |
boolean |
sync(java.lang.String edge,
byte[] value)
Callback for sync
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, isComplete, reset
protected ICompute task
protected java.util.concurrent.BlockingQueue<IMessage> inQueue
protected java.util.concurrent.BlockingQueue<IMessage> outQueue
protected Config config
protected OutputCollection outputCollection
protected int globalTaskId
protected int taskId
protected int taskIndex
protected int parallelism
protected java.lang.String taskName
protected java.util.Map<java.lang.String,java.lang.Object> nodeConfigs
protected java.util.Map<java.lang.String,IParallelOperation> outParOps
protected java.util.Map<java.lang.String,IParallelOperation> inParOps
protected int workerId
protected int lowWaterMark
protected int highWaterMark
protected java.util.Map<java.lang.String,java.lang.String> outputEdges
protected TaskSchedulePlan taskSchedule
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inputEdges
public TaskStreamingInstance(ICompute task, java.util.concurrent.BlockingQueue<IMessage> inQueue, java.util.concurrent.BlockingQueue<IMessage> outQueue, Config config, java.lang.String tName, int taskId, int globalTaskId, int tIndex, int parallel, int wId, java.util.Map<java.lang.String,java.lang.Object> cfgs, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inEdges, java.util.Map<java.lang.String,java.lang.String> outEdges, TaskSchedulePlan taskSchedule, CheckpointingClient checkpointingClient, java.lang.String taskGraphName, long tasksVersion)
public void prepare(Config cfg)
prepare
in interface INodeInstance
cfg
- configurationpublic void registerOutParallelOperation(java.lang.String edge, IParallelOperation op)
public void registerInParallelOperation(java.lang.String edge, IParallelOperation op)
public int getIndex()
getIndex
in interface INodeInstance
public boolean execute()
execute
in interface INodeInstance
public void scheduleBarriers(java.lang.Long bid)
public INode getNode()
INodeInstance
getNode
in interface INodeInstance
public void close()
INodeInstance
close
in interface INodeInstance
public java.util.concurrent.BlockingQueue<IMessage> getInQueue()