org.apache.flink.runtime.rpc.messages.RemoteHandshakeMessage Java Examples

The following examples show how to use org.apache.flink.runtime.rpc.messages.RemoteHandshakeMessage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AkkaRpcActor.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public void onReceive(final Object message) {
	if (message instanceof RemoteHandshakeMessage) {
		handleHandshakeMessage((RemoteHandshakeMessage) message);
	} else if (message instanceof ControlMessages) {
		handleControlMessage(((ControlMessages) message));
	} else if (state.isRunning()) {
		mainThreadValidator.enterMainThread();

		try {
			handleRpcMessage(message);
		} finally {
			mainThreadValidator.exitMainThread();
		}
	} else {
		log.info("The rpc endpoint {} has not been started yet. Discarding message {} until processing is started.",
			rpcEndpoint.getClass().getName(),
			message.getClass().getName());

		sendErrorIfSender(new AkkaRpcException(
			String.format("Discard message, because the rpc endpoint %s has not been started yet.", rpcEndpoint.getAddress())));
	}
}
 
Example #2
Source File: AkkaRpcActor.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private void handleHandshakeMessage(RemoteHandshakeMessage handshakeMessage) {
	if (!isCompatibleVersion(handshakeMessage.getVersion())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"Version mismatch between source (%s) and target (%s) rpc component. Please verify that all components have the same version.",
				handshakeMessage.getVersion(),
				getVersion())));
	} else if (!isGatewaySupported(handshakeMessage.getRpcGateway())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"The rpc endpoint does not support the gateway %s.",
				handshakeMessage.getRpcGateway().getSimpleName())));
	} else {
		getSender().tell(new Status.Success(HandshakeSuccessMessage.INSTANCE), getSelf());
	}
}
 
Example #3
Source File: AkkaRpcActor.java    From flink with Apache License 2.0 6 votes vote down vote up
private void handleHandshakeMessage(RemoteHandshakeMessage handshakeMessage) {
	if (!isCompatibleVersion(handshakeMessage.getVersion())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"Version mismatch between source (%s) and target (%s) rpc component. Please verify that all components have the same version.",
				handshakeMessage.getVersion(),
				getVersion())));
	} else if (!isGatewaySupported(handshakeMessage.getRpcGateway())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"The rpc endpoint does not support the gateway %s.",
				handshakeMessage.getRpcGateway().getSimpleName())));
	} else {
		getSender().tell(new Status.Success(HandshakeSuccessMessage.INSTANCE), getSelf());
	}
}
 
Example #4
Source File: AkkaRpcActor.java    From flink with Apache License 2.0 6 votes vote down vote up
private void handleHandshakeMessage(RemoteHandshakeMessage handshakeMessage) {
	if (!isCompatibleVersion(handshakeMessage.getVersion())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"Version mismatch between source (%s) and target (%s) rpc component. Please verify that all components have the same version.",
				handshakeMessage.getVersion(),
				getVersion())));
	} else if (!isGatewaySupported(handshakeMessage.getRpcGateway())) {
		sendErrorIfSender(new AkkaHandshakeException(
			String.format(
				"The rpc endpoint does not support the gateway %s.",
				handshakeMessage.getRpcGateway().getSimpleName())));
	} else {
		getSender().tell(new Status.Success(HandshakeSuccessMessage.INSTANCE), getSelf());
	}
}
 
Example #5
Source File: AkkaRpcActor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public Receive createReceive() {
	return ReceiveBuilder.create()
		.match(RemoteHandshakeMessage.class, this::handleHandshakeMessage)
		.match(ControlMessages.class, this::handleControlMessage)
		.matchAny(this::handleMessage)
		.build();
}
 
Example #6
Source File: AkkaRpcActor.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public Receive createReceive() {
	return ReceiveBuilder.create()
		.match(RemoteHandshakeMessage.class, this::handleHandshakeMessage)
		.match(ControlMessages.class, this::handleControlMessage)
		.matchAny(this::handleMessage)
		.build();
}