use of org.apache.flink.runtime.operators.coordination.CoordinationRequestHandler in project flink by apache.
the class DefaultOperatorCoordinatorHandler method deliverCoordinationRequestToCoordinator.
@Override
public CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator(OperatorID operator, CoordinationRequest request) throws FlinkException {
final OperatorCoordinatorHolder coordinatorHolder = coordinatorMap.get(operator);
if (coordinatorHolder == null) {
throw new FlinkException("Coordinator of operator " + operator + " does not exist or the job vertex this operator belongs to is not initialized.");
}
final OperatorCoordinator coordinator = coordinatorHolder.coordinator();
if (coordinator instanceof CoordinationRequestHandler) {
return ((CoordinationRequestHandler) coordinator).handleCoordinationRequest(request);
} else {
throw new FlinkException("Coordinator of operator " + operator + " cannot handle client event");
}
}
Aggregations