public class CleanupOnCloseRpcSystem extends Object implements RpcSystem
RpcSystem wrapper that cleans up resources after the RPC system has been closed.RpcSystem.FixedThreadPoolExecutorConfiguration, RpcSystem.ForkJoinExecutorConfiguration, RpcSystem.RpcServiceBuilder| Constructor and Description |
|---|
CleanupOnCloseRpcSystem(RpcSystem rpcSystem,
org.apache.flink.core.classloading.SubmoduleClassLoader pluginLoader,
Path tempDirectory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Hook to cleanup resources, like common thread pools or classloaders.
|
InetSocketAddress |
getInetSocketAddressFromRpcUrl(String url)
Returns an
InetSocketAddress corresponding to the given RPC url. |
long |
getMaximumMessageSizeInBytes(org.apache.flink.configuration.Configuration config)
Returns the maximum number of bytes that an RPC message may carry according to the given
configuration.
|
String |
getRpcUrl(String hostname,
int port,
String endpointName,
AddressResolution addressResolution,
org.apache.flink.configuration.Configuration config)
Constructs an RPC URL for the given parameters, that can be used to connect to the targeted
RpcService.
|
RpcSystem.RpcServiceBuilder |
localServiceBuilder(org.apache.flink.configuration.Configuration config)
Returns a builder for an
RpcService that is only reachable from the local machine. |
RpcSystem.RpcServiceBuilder |
remoteServiceBuilder(org.apache.flink.configuration.Configuration configuration,
String externalAddress,
String externalPortRange)
Returns a builder for an
RpcService that is reachable from other machines. |
public void close()
RpcSystemclose in interface AutoCloseableclose in interface RpcSystempublic RpcSystem.RpcServiceBuilder localServiceBuilder(org.apache.flink.configuration.Configuration config)
RpcSystemRpcService that is only reachable from the local machine.localServiceBuilder in interface RpcSystemconfig - Flink configurationpublic RpcSystem.RpcServiceBuilder remoteServiceBuilder(org.apache.flink.configuration.Configuration configuration, @Nullable String externalAddress, String externalPortRange)
RpcSystemRpcService that is reachable from other machines.remoteServiceBuilder in interface RpcSystemconfiguration - Flink configurationexternalAddress - optional address under which the RpcService should be reachableexternalPortRange - port range from which 1 port will be chosen under which the
RpcService should be reachablepublic String getRpcUrl(String hostname, int port, String endpointName, AddressResolution addressResolution, org.apache.flink.configuration.Configuration config) throws UnknownHostException
RpcSystemUtilsgetRpcUrl in interface RpcSystemUtilshostname - The hostname or address where the target RPC service is listening.port - The port where the target RPC service is listening.endpointName - The name of the RPC endpoint.addressResolution - Whether to try address resolution of the given hostname or not. This
allows to fail fast in case that the hostname cannot be resolved.config - The configuration from which to deduce further settings.UnknownHostExceptionpublic InetSocketAddress getInetSocketAddressFromRpcUrl(String url) throws Exception
RpcSystemUtilsInetSocketAddress corresponding to the given RPC url.getInetSocketAddressFromRpcUrl in interface RpcSystemUtilsurl - RPC urlException - if the URL is invalidRpcSystemUtils.getRpcUrl(java.lang.String, int, java.lang.String, org.apache.flink.runtime.rpc.AddressResolution, org.apache.flink.configuration.Configuration)public long getMaximumMessageSizeInBytes(org.apache.flink.configuration.Configuration config)
RpcSystemUtilsLong.MAX_VALUE should be returned.getMaximumMessageSizeInBytes in interface RpcSystemUtilsconfig - Flink configurationCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.