Interface ExecutorRepresenter
-
- All Known Implementing Classes:
DefaultExecutorRepresenter
public interface ExecutorRepresenter
Contains information/state regarding an executor Such information may include a) The executor's resource type. b) The executor's capacity (ex. number of cores). c) Tasks scheduled/launched for the executor. d) Name of the physical node which hosts this executor. e) (Please add other information as we implement more features).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getContainerType()
int
getExecutorCapacity()
java.lang.String
getExecutorId()
java.lang.String
getNodeName()
int
getNumOfComplyingRunningTasks()
int
getNumOfRunningTasks()
java.util.Set<Task>
getRunningTasks()
java.util.Set<java.lang.String>
onExecutorFailed()
Marks all Tasks which were running in this executor as failed.void
onTaskExecutionComplete(java.lang.String taskId)
Marks the specified Task as completed.void
onTaskExecutionFailed(java.lang.String taskId)
Marks the specified Task as failed.void
onTaskScheduled(Task task)
Marks the Task as running, and sends scheduling message to the executor.void
sendControlMessage(ControlMessage.Message message)
Sends control message to the executor.void
shutDown()
Shuts down this executor.
-
-
-
Method Detail
-
onExecutorFailed
java.util.Set<java.lang.String> onExecutorFailed()
Marks all Tasks which were running in this executor as failed.- Returns:
- set of identifiers of tasks that were running in this executor.
-
getExecutorCapacity
int getExecutorCapacity()
- Returns:
- how many Tasks can this executor simultaneously run
-
getRunningTasks
java.util.Set<Task> getRunningTasks()
- Returns:
- the current snapshot of set of Tasks that are running in this executor.
-
getNumOfRunningTasks
int getNumOfRunningTasks()
- Returns:
- the number of running
Task
s.
-
getNumOfComplyingRunningTasks
int getNumOfComplyingRunningTasks()
- Returns:
- the number of running
Task
s that complies to the executor slot restriction.
-
onTaskScheduled
void onTaskScheduled(Task task)
Marks the Task as running, and sends scheduling message to the executor.- Parameters:
task
- the task to run
-
sendControlMessage
void sendControlMessage(ControlMessage.Message message)
Sends control message to the executor.- Parameters:
message
- Message object to send
-
onTaskExecutionComplete
void onTaskExecutionComplete(java.lang.String taskId)
Marks the specified Task as completed.- Parameters:
taskId
- id of the completed task
-
getNodeName
java.lang.String getNodeName()
- Returns:
- physical name of the node where this executor resides
-
getExecutorId
java.lang.String getExecutorId()
- Returns:
- the executor id
-
getContainerType
java.lang.String getContainerType()
- Returns:
- the container type
-
shutDown
void shutDown()
Shuts down this executor.
-
onTaskExecutionFailed
void onTaskExecutionFailed(java.lang.String taskId)
Marks the specified Task as failed.- Parameters:
taskId
- id of the Task
-
-