public class TaskExecutor extends java.lang.Object implements FaultAcceptable
Constructor and Description |
---|
TaskExecutor(Config cfg,
int wId,
java.util.List<JobMasterAPI.WorkerInfo> workerInfoList,
Communicator net,
CheckpointingClient checkpointingClient)
Creates a task executor.
|
TaskExecutor(WorkerEnvironment workerEnv) |
Modifier and Type | Method and Description |
---|---|
void |
addInput(ComputeGraph graph,
ExecutionPlan plan,
java.lang.String taskName,
java.lang.String inputKey,
DataObject<?> input)
Deprecated.
Inputs are automatically handled now
|
void |
addInput(IExecutor ex,
java.lang.String taskName,
java.lang.String inputKey,
DataObject<?> input)
Deprecated.
Inputs are automatically handled now
|
void |
addInput(java.lang.String name,
DataObject dataObject) |
void |
addSourceInput(ComputeGraph graph,
ExecutionPlan plan,
java.lang.String inputKey,
DataObject<java.lang.Object> input)
Deprecated.
Inputs are handled automatically now
|
void |
addSourceInput(IExecutor ex,
java.lang.String inputKey,
DataObject<java.lang.Object> input)
Deprecated.
Inputs are handled automatically now
|
void |
clearData(java.lang.String var)
This method can be used to clear
DataPartition s collected from previous
task graphs, which are no longer required |
void |
close() |
static void |
collectData(Config cfg,
ExecutionPlan executionPlan,
java.util.Map<java.lang.String,DataObject> dataMap)
This method collects all the output from the provided
ExecutionPlan . |
IExecutor |
createExecution(ComputeGraph graph)
Execute a plan and a graph.
|
IExecutor |
createExecution(ComputeGraph graph,
ExecutionPlan plan)
Execute a plan and a graph.
|
static void |
distributeData(ExecutionPlan executionPlan,
java.util.Map<java.lang.String,DataObject> dataMap)
This method distributes collected
DataPartition s to the
intended Receptor s |
void |
execute(ComputeGraph graph)
Execute a plan and a graph.
|
void |
execute(ComputeGraph graph,
ExecutionPlan plan)
Execute a plan and a graph.
|
void |
execute(Config taskConfig,
ComputeGraph graph,
ExecutionPlan plan)
Execute a plan and a graph.
|
ExecutionPlan |
executionPlan(ComputeGraph graph,
TaskSchedulePlan taskSchedulePlan)
Create a execution plan
|
<T> DataObject<T> |
getOutput(ComputeGraph graph,
ExecutionPlan plan,
java.lang.String taskName)
Deprecated.
There is no need of using this method anymore.
Input - Output is handled automatically
|
<T> DataObject<T> |
getOutput(ComputeGraph graph,
ExecutionPlan plan,
java.lang.String taskName,
java.lang.String dataName)
Deprecated.
There is no need of using this method anymore.
Input - Output is handled automatically
|
<T> DataObject<T> |
getOutput(java.lang.String varName) |
boolean |
isOutputAvailable(java.lang.String name) |
void |
onFault(Fault fault)
A fault has occurred
|
java.util.Map<java.lang.String,ExecutionPlan> |
plan(ComputeGraph... graph)
Create execution plans for each graph.
|
ExecutionPlan |
plan(ComputeGraph graph)
Create an execution plan from the given graph
|
public TaskExecutor(Config cfg, int wId, java.util.List<JobMasterAPI.WorkerInfo> workerInfoList, Communicator net, CheckpointingClient checkpointingClient)
cfg
- the configurationwId
- the worker idnet
- communicatorpublic TaskExecutor(WorkerEnvironment workerEnv)
public ExecutionPlan plan(ComputeGraph graph)
graph
- task graphpublic java.util.Map<java.lang.String,ExecutionPlan> plan(ComputeGraph... graph)
graph
- list of graphspublic ExecutionPlan executionPlan(ComputeGraph graph, TaskSchedulePlan taskSchedulePlan)
graph
- the graphtaskSchedulePlan
- task schedulepublic void execute(Config taskConfig, ComputeGraph graph, ExecutionPlan plan)
taskConfig
- the user configuration to be passed to the task instancesgraph
- the dataflow graphplan
- the execution planpublic void execute(ComputeGraph graph, ExecutionPlan plan)
graph
- the dataflow graphplan
- the execution planpublic void execute(ComputeGraph graph)
graph
- the dataflow graphpublic IExecutor createExecution(ComputeGraph graph, ExecutionPlan plan)
graph
- the dataflow graphplan
- the execution planpublic IExecutor createExecution(ComputeGraph graph)
graph
- the dataflow graph@Deprecated public void addInput(ComputeGraph graph, ExecutionPlan plan, java.lang.String taskName, java.lang.String inputKey, DataObject<?> input)
graph
- task graphplan
- execution plantaskName
- task nameinputKey
- inputkeyinput
- input@Deprecated public void addInput(IExecutor ex, java.lang.String taskName, java.lang.String inputKey, DataObject<?> input)
ex
- execution plantaskName
- task nameinputKey
- inputkeyinput
- input@Deprecated public void addSourceInput(ComputeGraph graph, ExecutionPlan plan, java.lang.String inputKey, DataObject<java.lang.Object> input)
graph
- task graphplan
- execution planinputKey
- inputkeyinput
- input@Deprecated public void addSourceInput(IExecutor ex, java.lang.String inputKey, DataObject<java.lang.Object> input)
ex
- execution planinputKey
- inputkeyinput
- input@Deprecated public <T> DataObject<T> getOutput(ComputeGraph graph, ExecutionPlan plan, java.lang.String taskName)
graph
- the graphplan
- plan created from the graphtaskName
- name of the output to retrieve@Deprecated public <T> DataObject<T> getOutput(ComputeGraph graph, ExecutionPlan plan, java.lang.String taskName, java.lang.String dataName)
graph
- the graphplan
- plan created from the graphtaskName
- name of the output to retrievedataName
- name of the data setpublic <T> DataObject<T> getOutput(java.lang.String varName)
public boolean isOutputAvailable(java.lang.String name)
public void addInput(java.lang.String name, DataObject dataObject)
public static void collectData(Config cfg, ExecutionPlan executionPlan, java.util.Map<java.lang.String,DataObject> dataMap)
ExecutionPlan
.
The partition IDs will be assigned just before adding the partitions to the DataObject
public static void distributeData(ExecutionPlan executionPlan, java.util.Map<java.lang.String,DataObject> dataMap)
DataPartition
s to the
intended Receptor
spublic void clearData(java.lang.String var)
DataPartition
s collected from previous
task graphs, which are no longer requiredpublic void close()
public void onFault(Fault fault)
FaultAcceptable
onFault
in interface FaultAcceptable
fault
- the fault