public class TaskContextImpl extends java.lang.Object implements TaskContext
| Constructor and Description |
|---|
TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inputs,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode) |
TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
OutputCollection collection,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inputs,
java.util.Map<java.lang.String,java.lang.String> outEdges,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode) |
TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
OutputCollection collection,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.lang.String> outEdges,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
end(java.lang.String edge)
End the current writing
|
void |
endAll()
Ends all edges
|
java.lang.Object |
getConfig(java.lang.String name)
Get a configuration with a name
|
java.util.Map<java.lang.String,java.lang.Object> |
getConfigurations()
Get the task specific configurations
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getInEdges()
Get the edge names and the tasks connected using those edges
|
OperationMode |
getOperationMode()
Get the operation mode of the task graph
|
java.util.Map<java.lang.String,java.lang.String> |
getOutEdges()
Get the out edges of this task
|
int |
getParallelism()
Get the parallism of the task
|
int |
getWorkerId()
Get the worker id this task is running
|
java.util.Set<WorkerSchedulePlan> |
getWorkers()
Set of workers in the current topology
|
java.util.Map<java.lang.Integer,WorkerSchedulePlan> |
getWorkersMap()
Map of worker where value is the container id
|
int |
globalTaskId()
Globally unique id
|
boolean |
isCompleted()
Weather all the edges are finished (whether the task is completed)
|
boolean |
isDone(java.lang.String edge)
Return true, if this task is done
|
void |
reset()
Reset the context
|
int |
taskId()
Get the task id for this task
|
int |
taskIndex()
The task index
|
java.lang.String |
taskName()
Name of the task
|
boolean |
write(java.lang.String edge,
java.lang.Object message)
Write a message to the destination
|
boolean |
write(java.lang.String edge,
java.lang.Object key,
java.lang.Object message)
Write a message with a key
|
boolean |
writeBarrier(java.lang.String edge,
java.lang.Object message)
Write a barrier message to the destination
|
boolean |
writeEnd(java.lang.String edge,
java.lang.Object message)
Write the last message
|
boolean |
writeEnd(java.lang.String edge,
java.lang.Object key,
java.lang.Object message)
Write the last message
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTasksByName, getTasksInThisWorkerByName, getWorkerpublic TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inputs,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode)
public TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
OutputCollection collection,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.lang.String> outEdges,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode)
public TaskContextImpl(int taskIndex,
int taskId,
int globalTaskId,
java.lang.String taskName,
int parallelism,
int wId,
OutputCollection collection,
java.util.Map<java.lang.String,java.lang.Object> configs,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> inputs,
java.util.Map<java.lang.String,java.lang.String> outEdges,
TaskSchedulePlan taskSchedulePlan,
OperationMode opMode)
public java.util.Set<WorkerSchedulePlan> getWorkers()
TaskContextgetWorkers in interface TaskContextpublic java.util.Map<java.lang.Integer,WorkerSchedulePlan> getWorkersMap()
TaskContextgetWorkersMap in interface TaskContextpublic OperationMode getOperationMode()
TaskContextgetOperationMode in interface TaskContextpublic void reset()
reset in interface TaskContextpublic int taskIndex()
taskIndex in interface TaskContextpublic int globalTaskId()
globalTaskId in interface TaskContextpublic int taskId()
taskId in interface TaskContextpublic java.lang.String taskName()
taskName in interface TaskContextpublic int getParallelism()
getParallelism in interface TaskContextpublic int getWorkerId()
getWorkerId in interface TaskContextpublic java.util.Map<java.lang.String,java.lang.Object> getConfigurations()
getConfigurations in interface TaskContextpublic java.lang.Object getConfig(java.lang.String name)
getConfig in interface TaskContextname - name of the configpublic java.util.Map<java.lang.String,java.lang.String> getOutEdges()
getOutEdges in interface TaskContextpublic java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getInEdges()
getInEdges in interface TaskContextpublic boolean write(java.lang.String edge,
java.lang.Object key,
java.lang.Object message)
write in interface TaskContextedge - the edgekey - keymessage - messagepublic boolean write(java.lang.String edge,
java.lang.Object message)
write in interface TaskContextedge - edgemessage - messagepublic boolean writeBarrier(java.lang.String edge,
java.lang.Object message)
TaskContextwriteBarrier in interface TaskContextedge - edgemessage - messagepublic boolean writeEnd(java.lang.String edge,
java.lang.Object message)
writeEnd in interface TaskContextedge - edgemessage - messagepublic boolean writeEnd(java.lang.String edge,
java.lang.Object key,
java.lang.Object message)
writeEnd in interface TaskContextedge - edgekey - keymessage - messagepublic void end(java.lang.String edge)
end in interface TaskContextedge - edgepublic void endAll()
endAll in interface TaskContextpublic boolean isDone(java.lang.String edge)
isDone in interface TaskContextedge - edge namepublic boolean isCompleted()