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;
}
}
Aggregations