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 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 Tasks.
      • getNumOfComplyingRunningTasks

        int getNumOfComplyingRunningTasks()
        Returns:
        the number of running Tasks 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