Class TaskExecutor


  • @NotThreadSafe
    public final class TaskExecutor
    extends java.lang.Object
    Executes a task. Should be accessed by a single thread.
    • Constructor Detail

      • TaskExecutor

        public TaskExecutor​(Task task,
                            DAG<IRVertex,​RuntimeEdge<IRVertex>> irVertexDag,
                            TaskStateManager taskStateManager,
                            IntermediateDataIOFactory intermediateDataIOFactory,
                            BroadcastManagerWorker broadcastManagerWorker,
                            MetricMessageSender metricMessageSender,
                            PersistentConnectionToMasterMap persistentConnectionToMasterMap,
                            int latencyMarkPeriod)
        Constructor.
        Parameters:
        task - Task with information needed during execution.
        irVertexDag - A DAG of vertices.
        taskStateManager - State manager for this Task.
        intermediateDataIOFactory - For reading from/writing to data to other tasks.
        broadcastManagerWorker - For broadcasts.
        metricMessageSender - For sending metric with execution stats to the master.
        persistentConnectionToMasterMap - For sending messages to the master.
    • Method Detail

      • sendStreamMetric

        public void sendStreamMetric()
        Send stream metric to the runtime master. This method should be called only on a different thread with taskExecutor. Because this method can greatly affect to the performance.
      • execute

        public void execute()
        Execute a task, while handling unrecoverable errors and exceptions.
      • sendMetrics

        public void sendMetrics()
        Send data-processing metrics.
      • setIRVertexPutOnHold

        public void setIRVertexPutOnHold​(IRVertex irVertex)