Package org.apache.flink.runtime.rpc
Interface RpcSystemUtils
-
- All Known Subinterfaces:
RpcSystem
- All Known Implementing Classes:
CleanupOnCloseRpcSystem
public interface RpcSystemUtilsUtils that are dependent on the underlying RPC implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InetSocketAddressgetInetSocketAddressFromRpcUrl(String url)Returns anInetSocketAddresscorresponding to the given RPC url.longgetMaximumMessageSizeInBytes(org.apache.flink.configuration.Configuration config)Returns the maximum number of bytes that an RPC message may carry according to the given configuration.StringgetRpcUrl(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.
-
-
-
Method Detail
-
getRpcUrl
String getRpcUrl(String hostname, int port, String endpointName, AddressResolution addressResolution, org.apache.flink.configuration.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 anInetSocketAddresscorresponding 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(org.apache.flink.configuration.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_VALUEshould be returned.- Parameters:
config- Flink configuration- Returns:
- maximum number of bytes that an RPC message may carry
-
-