use of org.apache.flink.runtime.jobgraph.tasks.CoordinatedTask in project flink by apache.
the class Task method deliverOperatorEvent.
/**
* Dispatches an operator event to the invokable task.
*
* <p>If the event delivery did not succeed, this method throws an exception. Callers can use
* that exception for error reporting, but need not react with failing this task (this method
* takes care of that).
*
* @throws FlinkException This method throws exceptions indicating the reason why delivery did
* not succeed.
*/
public void deliverOperatorEvent(OperatorID operator, SerializedValue<OperatorEvent> evt) throws FlinkException {
final TaskInvokable invokable = this.invokable;
final ExecutionState currentState = this.executionState;
if (invokable == null || (currentState != ExecutionState.RUNNING && currentState != ExecutionState.INITIALIZING)) {
throw new TaskNotRunningException("Task is not running, but in state " + currentState);
}
if (invokable instanceof CoordinatedTask) {
try {
((CoordinatedTask) invokable).dispatchOperatorEvent(operator, evt);
} catch (Throwable t) {
ExceptionUtils.rethrowIfFatalErrorOrOOM(t);
if (getExecutionState() == ExecutionState.RUNNING || getExecutionState() == ExecutionState.INITIALIZING) {
FlinkException e = new FlinkException("Error while handling operator event", t);
failExternally(e);
throw e;
}
}
}
}
Aggregations