public class RpcUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Duration |
INF_DURATION |
static org.apache.flink.api.common.time.Time |
INF_TIMEOUT
HACK: Set to 21474835 seconds, Pekko's maximum delay (Akka 2.4.20).
|
| Modifier and Type | Method and Description |
|---|---|
static RpcService |
createRemoteRpcService(RpcSystem rpcSystem,
org.apache.flink.configuration.Configuration configuration,
String externalAddress,
String externalPortRange,
String bindAddress,
Optional<Integer> bindPort)
Convenient shortcut for constructing a remote RPC Service that takes care of checking for
null and empty optionals.
|
static Set<Class<? extends RpcGateway>> |
extractImplementedRpcGateways(Class<?> clazz)
Extracts all
RpcGateway interfaces implemented by the given clazz. |
static String |
getHostname(RpcService rpcService)
Returns the hostname onto which the given
RpcService has been bound. |
static RpcSystem.ForkJoinExecutorConfiguration |
getTestForkJoinExecutorConfiguration() |
static void |
terminateRpcEndpoint(RpcEndpoint... rpcEndpoints)
Shuts the given
RpcEndpoints down and awaits their termination. |
static void |
terminateRpcService(RpcService... rpcServices)
Shuts the given rpc services down and waits for their termination.
|
public static final org.apache.flink.api.common.time.Time INF_TIMEOUT
IllegalArgumentException will be thrown during an RPC. Check the
private method checkMaxDelay() in org.apache.pekko.actor.LightArrayRevolverScheduler.public static final Duration INF_DURATION
public static Set<Class<? extends RpcGateway>> extractImplementedRpcGateways(Class<?> clazz)
RpcGateway interfaces implemented by the given clazz.clazz - from which to extract the implemented RpcGateway interfaces@VisibleForTesting public static void terminateRpcEndpoint(RpcEndpoint... rpcEndpoints) throws ExecutionException, InterruptedException
RpcEndpoints down and awaits their termination.rpcEndpoints - to terminateExecutionException - if a problem occurredInterruptedException - if the operation has been interrupted@VisibleForTesting public static void terminateRpcService(RpcService... rpcServices) throws InterruptedException, ExecutionException
rpcServices - to shut downInterruptedException - if the operation has been interruptedExecutionException - if a problem occurredpublic static String getHostname(RpcService rpcService)
RpcService has been bound. If the RpcService has been started in local mode, then the hostname is "hostname".rpcService - to retrieve the hostname forRpcService has been bound or localhostpublic static RpcSystem.ForkJoinExecutorConfiguration getTestForkJoinExecutorConfiguration()
public static RpcService createRemoteRpcService(RpcSystem rpcSystem, org.apache.flink.configuration.Configuration configuration, @Nullable String externalAddress, String externalPortRange, @Nullable String bindAddress, Optional<Integer> bindPort) throws Exception
ExceptionRpcSystem.remoteServiceBuilder(Configuration, String, String)Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.