Search in sources :

Example 1 with CoordinationRequestHandler

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");
    }
}
Also used : CoordinationRequestHandler(org.apache.flink.runtime.operators.coordination.CoordinationRequestHandler) OperatorCoordinatorHolder(org.apache.flink.runtime.operators.coordination.OperatorCoordinatorHolder) OperatorCoordinator(org.apache.flink.runtime.operators.coordination.OperatorCoordinator) FlinkException(org.apache.flink.util.FlinkException)

Aggregations

CoordinationRequestHandler (org.apache.flink.runtime.operators.coordination.CoordinationRequestHandler)1 OperatorCoordinator (org.apache.flink.runtime.operators.coordination.OperatorCoordinator)1 OperatorCoordinatorHolder (org.apache.flink.runtime.operators.coordination.OperatorCoordinatorHolder)1 FlinkException (org.apache.flink.util.FlinkException)1