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 the PekkoInvocationHandler. This invocation handler will be used in combination with the FencedRpcEndpoint. The fencing is done by wrapping all messages in a FencedMessage.
  • Field Details

    • isLocal

      protected final boolean isLocal
    • forceRpcInvocationSerialization

      protected final boolean forceRpcInvocationSerialization
  • Constructor Details

    • FencedPekkoInvocationHandler

      public FencedPekkoInvocationHandler(String address, String hostname, org.apache.pekko.actor.ActorRef rpcEndpoint, Duration timeout, long maximumFramesize, boolean forceRpcInvocationSerialization, @Nullable CompletableFuture<Void> terminationFuture, Supplier<F> fencingTokenSupplier, boolean captureAskCallStacks, ClassLoader flinkClassLoader)
  • Method Details

    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Specified by:
      invoke in interface InvocationHandler
      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, Duration timeout)
      Sends the message to the RPC endpoint and returns a future containing its response.
      Parameters:
      message - to send to the RPC endpoint
      timeout - time to wait until the response future is failed with a TimeoutException
      Returns:
      Response future
    • getFencingToken

      public F getFencingToken()
      Specified by:
      getFencingToken in interface org.apache.flink.runtime.rpc.FencedRpcGateway<F extends Serializable>
    • getActorRef

      public org.apache.pekko.actor.ActorRef getActorRef()
    • runAsync

      public void runAsync(Runnable runnable)
      Specified by:
      runAsync in interface org.apache.flink.runtime.rpc.MainThreadExecutable
    • scheduleRunAsync

      public void scheduleRunAsync(Runnable runnable, long delayMillis)
      Specified by:
      scheduleRunAsync in interface org.apache.flink.runtime.rpc.MainThreadExecutable
    • callAsync

      public <V> CompletableFuture<V> callAsync(Callable<V> callable, Duration callTimeout)
      Specified by:
      callAsync in interface org.apache.flink.runtime.rpc.MainThreadExecutable
    • start

      public void start()
      Specified by:
      start in interface org.apache.flink.runtime.rpc.StartStoppable
    • stop

      public void stop()
      Specified by:
      stop in interface org.apache.flink.runtime.rpc.StartStoppable
    • getAddress

      public String getAddress()
      Specified by:
      getAddress in interface org.apache.flink.runtime.rpc.RpcGateway
    • getHostname

      public String getHostname()
      Specified by:
      getHostname in interface org.apache.flink.runtime.rpc.RpcGateway
    • getTerminationFuture

      public CompletableFuture<Void> getTerminationFuture()
      Specified by:
      getTerminationFuture in interface org.apache.flink.runtime.rpc.RpcServer