Package org.apache.flink.runtime.rpc
Interface RpcSystemUtils
-
- All Known Subinterfaces:
RpcSystem
- All Known Implementing Classes:
CleanupOnCloseRpcSystem
,PekkoRpcSystem
public interface RpcSystemUtils
Utils that are dependent on the underlying RPC implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InetSocketAddress
getInetSocketAddressFromRpcUrl(String url)
Returns anInetSocketAddress
corresponding to the given RPC url.long
getMaximumMessageSizeInBytes(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, Configuration config)
Constructs an RPC URL for the given parameters, that can be used to connect to the targeted RpcService.
-
-
-
Method Detail
-
getRpcUrl
String getRpcUrl(String hostname, int port, String endpointName, AddressResolution addressResolution, Configuration config) throws UnknownHostException
Constructs an RPC URL for the given parameters, that can be used to connect to the targeted RpcService.- Parameters:
hostname
- 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.- Returns:
- The RPC URL of the specified RPC endpoint.
- Throws:
UnknownHostException
-
getInetSocketAddressFromRpcUrl
InetSocketAddress getInetSocketAddressFromRpcUrl(String url) throws Exception
Returns anInetSocketAddress
corresponding to the given RPC url.- Parameters:
url
- RPC url- Returns:
- inet socket address
- Throws:
Exception
- if the URL is invalid- See Also:
getRpcUrl(java.lang.String, int, java.lang.String, org.apache.flink.runtime.rpc.AddressResolution, org.apache.flink.configuration.Configuration)
-
getMaximumMessageSizeInBytes
long getMaximumMessageSizeInBytes(Configuration config)
Returns the maximum number of bytes that an RPC message may carry according to the given configuration. If no limit exists thenLong.MAX_VALUE
should be returned.- Parameters:
config
- Flink configuration- Returns:
- maximum number of bytes that an RPC message may carry
-
-