Class FencedPekkoInvocationHandler<F extends Serializable>
- java.lang.Object
-
- org.apache.flink.runtime.rpc.pekko.FencedPekkoInvocationHandler<F>
-
- Type Parameters:
F- type of the fencing token
- All Implemented Interfaces:
InvocationHandler,org.apache.flink.runtime.rpc.FencedRpcGateway<F>,org.apache.flink.runtime.rpc.MainThreadExecutable,org.apache.flink.runtime.rpc.RpcGateway,org.apache.flink.runtime.rpc.RpcServer,org.apache.flink.runtime.rpc.StartStoppable
public class FencedPekkoInvocationHandler<F extends Serializable> extends Object implements org.apache.flink.runtime.rpc.MainThreadExecutable, org.apache.flink.runtime.rpc.FencedRpcGateway<F>
Fenced extension of thePekkoInvocationHandler. This invocation handler will be used in combination with theFencedRpcEndpoint. The fencing is done by wrapping all messages in aFencedMessage.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanforceRpcInvocationSerializationprotected booleanisLocal
-
Constructor Summary
Constructors Constructor Description FencedPekkoInvocationHandler(String address, String hostname, org.apache.pekko.actor.ActorRef rpcEndpoint, java.time.Duration timeout, long maximumFramesize, boolean forceRpcInvocationSerialization, CompletableFuture<Void> terminationFuture, java.util.function.Supplier<F> fencingTokenSupplier, boolean captureAskCallStacks, ClassLoader flinkClassLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<?>ask(Object message, java.time.Duration timeout)Sends the message to the RPC endpoint and returns a future containing its response.<V> CompletableFuture<V>callAsync(Callable<V> callable, java.time.Duration callTimeout)org.apache.pekko.actor.ActorRefgetActorRef()StringgetAddress()FgetFencingToken()StringgetHostname()CompletableFuture<Void>getTerminationFuture()Objectinvoke(Object proxy, Method method, Object[] args)voidrunAsync(Runnable runnable)voidscheduleRunAsync(Runnable runnable, long delayMillis)voidstart()voidstop()voidtell(Object message)Sends the message to the RPC endpoint.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
FencedPekkoInvocationHandler
public FencedPekkoInvocationHandler(String address, String hostname, org.apache.pekko.actor.ActorRef rpcEndpoint, java.time.Duration timeout, long maximumFramesize, boolean forceRpcInvocationSerialization, @Nullable CompletableFuture<Void> terminationFuture, java.util.function.Supplier<F> fencingTokenSupplier, boolean captureAskCallStacks, ClassLoader flinkClassLoader)
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
tell
public void tell(Object message)
Sends the message to the RPC endpoint.- Parameters:
message- to send to the RPC endpoint.
-
ask
public CompletableFuture<?> ask(Object message, java.time.Duration timeout)
Sends the message to the RPC endpoint and returns a future containing its response.- Parameters:
message- to send to the RPC endpointtimeout- time to wait until the response future is failed with aTimeoutException- Returns:
- Response future
-
getFencingToken
public F getFencingToken()
- Specified by:
getFencingTokenin interfaceorg.apache.flink.runtime.rpc.FencedRpcGateway<F extends Serializable>
-
getActorRef
public org.apache.pekko.actor.ActorRef getActorRef()
-
runAsync
public void runAsync(Runnable runnable)
- Specified by:
runAsyncin interfaceorg.apache.flink.runtime.rpc.MainThreadExecutable
-
scheduleRunAsync
public void scheduleRunAsync(Runnable runnable, long delayMillis)
- Specified by:
scheduleRunAsyncin interfaceorg.apache.flink.runtime.rpc.MainThreadExecutable
-
callAsync
public <V> CompletableFuture<V> callAsync(Callable<V> callable, java.time.Duration callTimeout)
- Specified by:
callAsyncin interfaceorg.apache.flink.runtime.rpc.MainThreadExecutable
-
start
public void start()
- Specified by:
startin interfaceorg.apache.flink.runtime.rpc.StartStoppable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.apache.flink.runtime.rpc.StartStoppable
-
getAddress
public String getAddress()
- Specified by:
getAddressin interfaceorg.apache.flink.runtime.rpc.RpcGateway
-
getHostname
public String getHostname()
- Specified by:
getHostnamein interfaceorg.apache.flink.runtime.rpc.RpcGateway
-
getTerminationFuture
public CompletableFuture<Void> getTerminationFuture()
- Specified by:
getTerminationFuturein interfaceorg.apache.flink.runtime.rpc.RpcServer
-
-