flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
/**
	 * Invokes a RPC method by sending the RPC invocation details to the rpc endpoint.
	 *
	 * @param method to call
	 * @param args of the method call
	 * @return result of the RPC
	 * @throws Exception if the RPC invocation fails
	 */
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint.
@param method to call
@param args of the method call
@return result of the RPC
@throws Exception if the RPC invocation fails
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint . @param method to call @param args of the method call @return result of the RPC @throws Exception if the RPC invocation fails
private Object invokeRpc(Method method, Object[] args) throws Exception {
		String methodName = method.getName();
		Class<?>[] parameterTypes = method.getParameterTypes();
		Annotation[][] parameterAnnotations = method.getParameterAnnotations();
		Time futureTimeout = extractRpcTimeout(parameterAnnotations, args, timeout);
		final RpcInvocation rpcInvocation = createRpcInvocationMessage(methodName, parameterTypes, args);
		Class<?> returnType = method.getReturnType();
		final Object result;
		if (Objects.equals(returnType, Void.TYPE)) {
			tell(rpcInvocation);
			result = null;
		} else if (Objects.equals(returnType,CompletableFuture.class)) {
			result = ask(rpcInvocation, futureTimeout);
		} else {
			CompletableFuture<?> futureResult = ask(rpcInvocation, futureTimeout);
			result = futureResult.get(futureTimeout.getSize(), futureTimeout.getUnit());
		}
		return result;
	}
private Object invokeRpc ( Method method , Object [ ] args ) throws Exception { String methodName = method . getName ( ) ; Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; Annotation [ ] [ ] parameterAnnotations = method . getParameterAnnotations ( ) ; Time futureTimeout = extractRpcTimeout ( parameterAnnotations , args , timeout ) ; final RpcInvocation rpcInvocation = createRpcInvocationMessage ( methodName , parameterTypes , args ) ; Class < ? > returnType = method . getReturnType ( ) ; final Object result ; if ( Objects . equals ( returnType , Void . TYPE ) ) { tell ( rpcInvocation ) ; result = null ; } else if ( Objects . equals ( returnType , CompletableFuture . class ) ) { result = ask ( rpcInvocation , futureTimeout ) ; } else { CompletableFuture < ? > futureResult = ask ( rpcInvocation , futureTimeout ) ; result = futureResult . get ( futureTimeout . getSize ( ) , futureTimeout . getUnit ( ) ) ; } return result ; }
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint.
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint .
// execute an asynchronous call // execute a synchronous call