Search in sources :

Example 1 with AkkaRpcRuntimeException

use of org.apache.flink.runtime.rpc.akka.exceptions.AkkaRpcRuntimeException in project flink by apache.

the class AkkaRpcService method registerAkkaRpcActor.

private <C extends RpcEndpoint & RpcGateway> SupervisorActor.ActorRegistration registerAkkaRpcActor(C rpcEndpoint) {
    final Class<? extends AbstractActor> akkaRpcActorType;
    if (rpcEndpoint instanceof FencedRpcEndpoint) {
        akkaRpcActorType = FencedAkkaRpcActor.class;
    } else {
        akkaRpcActorType = AkkaRpcActor.class;
    }
    synchronized (lock) {
        checkState(!stopped, "RpcService is stopped");
        final SupervisorActor.StartAkkaRpcActorResponse startAkkaRpcActorResponse = SupervisorActor.startAkkaRpcActor(supervisor.getActor(), actorTerminationFuture -> Props.create(akkaRpcActorType, rpcEndpoint, actorTerminationFuture, getVersion(), configuration.getMaximumFramesize(), flinkClassLoader), rpcEndpoint.getEndpointId());
        final SupervisorActor.ActorRegistration actorRegistration = startAkkaRpcActorResponse.orElseThrow(cause -> new AkkaRpcRuntimeException(String.format("Could not create the %s for %s.", AkkaRpcActor.class.getSimpleName(), rpcEndpoint.getEndpointId()), cause));
        actors.put(actorRegistration.getActorRef(), rpcEndpoint);
        return actorRegistration;
    }
}
Also used : AkkaRpcRuntimeException(org.apache.flink.runtime.rpc.akka.exceptions.AkkaRpcRuntimeException) FencedRpcEndpoint(org.apache.flink.runtime.rpc.FencedRpcEndpoint)

Aggregations

FencedRpcEndpoint (org.apache.flink.runtime.rpc.FencedRpcEndpoint)1 AkkaRpcRuntimeException (org.apache.flink.runtime.rpc.akka.exceptions.AkkaRpcRuntimeException)1