use of org.apache.flink.runtime.rpc.akka.exceptions.AkkaUnknownMessageException in project flink by apache.
the class FencedAkkaRpcActor method handleRpcMessage.
@Override
protected void handleRpcMessage(Object message) {
if (message instanceof FencedMessage) {
final F expectedFencingToken = rpcEndpoint.getFencingToken();
if (expectedFencingToken == null) {
if (log.isDebugEnabled()) {
log.debug("Fencing token not set: Ignoring message {} because the fencing token is null.", message);
}
sendErrorIfSender(new FencingTokenException(String.format("Fencing token not set: Ignoring message %s sent to %s because the fencing token is null.", message, rpcEndpoint.getAddress())));
} else {
@SuppressWarnings("unchecked") FencedMessage<F, ?> fencedMessage = ((FencedMessage<F, ?>) message);
F fencingToken = fencedMessage.getFencingToken();
if (Objects.equals(expectedFencingToken, fencingToken)) {
super.handleRpcMessage(fencedMessage.getPayload());
} else {
if (log.isDebugEnabled()) {
log.debug("Fencing token mismatch: Ignoring message {} because the fencing token {} did " + "not match the expected fencing token {}.", message, fencingToken, expectedFencingToken);
}
sendErrorIfSender(new FencingTokenException("Fencing token mismatch: Ignoring message " + message + " because the fencing token " + fencingToken + " did not match the expected fencing token " + expectedFencingToken + '.'));
}
}
} else if (message instanceof UnfencedMessage) {
super.handleRpcMessage(((UnfencedMessage<?>) message).getPayload());
} else {
if (log.isDebugEnabled()) {
log.debug("Unknown message type: Ignoring message {} because it is neither of type {} nor {}.", message, FencedMessage.class.getSimpleName(), UnfencedMessage.class.getSimpleName());
}
sendErrorIfSender(new AkkaUnknownMessageException("Unknown message type: Ignoring message " + message + " of type " + message.getClass().getSimpleName() + " because it is neither of type " + FencedMessage.class.getSimpleName() + " nor " + UnfencedMessage.class.getSimpleName() + '.'));
}
}
use of org.apache.flink.runtime.rpc.akka.exceptions.AkkaUnknownMessageException in project flink by apache.
the class AkkaRpcActor method handleRpcMessage.
protected void handleRpcMessage(Object message) {
if (message instanceof RunAsync) {
handleRunAsync((RunAsync) message);
} else if (message instanceof CallAsync) {
handleCallAsync((CallAsync) message);
} else if (message instanceof RpcInvocation) {
handleRpcInvocation((RpcInvocation) message);
} else {
log.warn("Received message of unknown type {} with value {}. Dropping this message!", message.getClass().getName(), message);
sendErrorIfSender(new AkkaUnknownMessageException("Received unknown message " + message + " of type " + message.getClass().getSimpleName() + '.'));
}
}
use of org.apache.flink.runtime.rpc.akka.exceptions.AkkaUnknownMessageException in project flink by apache.
the class AkkaRpcActor method handleUnknownControlMessage.
private void handleUnknownControlMessage(ControlMessages controlMessage) {
final String message = String.format("Received unknown control message %s. Dropping this message!", controlMessage);
log.warn(message);
sendErrorIfSender(new AkkaUnknownMessageException(message));
}
use of org.apache.flink.runtime.rpc.akka.exceptions.AkkaUnknownMessageException in project flink by apache.
the class SupervisorActor method handleUnknownMessage.
private void handleUnknownMessage(Object msg) {
final AkkaUnknownMessageException cause = new AkkaUnknownMessageException(String.format("Cannot handle unknown message %s.", msg));
getSender().tell(new akka.actor.Status.Failure(cause), getSelf());
throw cause;
}
Aggregations