Search in sources :

Example 1 with TaskExecutorOperatorEventGateway

use of org.apache.flink.runtime.taskexecutor.TaskExecutorOperatorEventGateway in project flink by apache.

the class Execution method sendOperatorEvent.

/**
 * Sends the operator event to the Task on the Task Executor.
 *
 * @return True, of the message was sent, false is the task is currently not running.
 */
public CompletableFuture<Acknowledge> sendOperatorEvent(OperatorID operatorId, SerializedValue<OperatorEvent> event) {
    assertRunningInJobMasterMainThread();
    final LogicalSlot slot = assignedResource;
    if (slot != null && (getState() == RUNNING || getState() == INITIALIZING)) {
        final TaskExecutorOperatorEventGateway eventGateway = slot.getTaskManagerGateway();
        return eventGateway.sendOperatorEventToTask(getAttemptId(), operatorId, event);
    } else {
        return FutureUtils.completedExceptionally(new TaskNotRunningException('"' + vertex.getTaskNameWithSubtaskIndex() + "\" is not running, but in state " + getState()));
    }
}
Also used : TaskExecutorOperatorEventGateway(org.apache.flink.runtime.taskexecutor.TaskExecutorOperatorEventGateway) TaskNotRunningException(org.apache.flink.runtime.operators.coordination.TaskNotRunningException) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot)

Aggregations

LogicalSlot (org.apache.flink.runtime.jobmaster.LogicalSlot)1 TaskNotRunningException (org.apache.flink.runtime.operators.coordination.TaskNotRunningException)1 TaskExecutorOperatorEventGateway (org.apache.flink.runtime.taskexecutor.TaskExecutorOperatorEventGateway)1