Class PekkoRpcSystem
- java.lang.Object
-
- org.apache.flink.runtime.rpc.pekko.PekkoRpcSystem
-
- All Implemented Interfaces:
AutoCloseable
,RpcSystem
,RpcSystemUtils
public class PekkoRpcSystem extends Object implements RpcSystem
RpcSystem
implementation based on Pekko.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.rpc.RpcSystem
RpcSystem.FixedThreadPoolExecutorConfiguration, RpcSystem.ForkJoinExecutorConfiguration, RpcSystem.RpcServiceBuilder
-
-
Constructor Summary
Constructors Constructor Description PekkoRpcSystem()
-
Method Summary
All Methods Instance Methods Concrete 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.RpcSystem.RpcServiceBuilder
localServiceBuilder(Configuration configuration)
Returns a builder for anRpcService
that is only reachable from the local machine.RpcSystem.RpcServiceBuilder
remoteServiceBuilder(Configuration configuration, String externalAddress, String externalPortRange)
Returns a builder for anRpcService
that is reachable from other machines.
-
-
-
Method Detail
-
localServiceBuilder
public RpcSystem.RpcServiceBuilder localServiceBuilder(Configuration configuration)
Description copied from interface:RpcSystem
Returns a builder for anRpcService
that is only reachable from the local machine.- Specified by:
localServiceBuilder
in interfaceRpcSystem
- Parameters:
configuration
- Flink configuration- Returns:
- rpc service builder
-
remoteServiceBuilder
public RpcSystem.RpcServiceBuilder remoteServiceBuilder(Configuration configuration, @Nullable String externalAddress, String externalPortRange)
Description copied from interface:RpcSystem
Returns a builder for anRpcService
that is reachable from other machines.- Specified by:
remoteServiceBuilder
in interfaceRpcSystem
- Parameters:
configuration
- 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 reachable- Returns:
- rpc service builder
-
getInetSocketAddressFromRpcUrl
public InetSocketAddress getInetSocketAddressFromRpcUrl(String url) throws Exception
Description copied from interface:RpcSystemUtils
Returns anInetSocketAddress
corresponding to the given RPC url.- Specified by:
getInetSocketAddressFromRpcUrl
in interfaceRpcSystemUtils
- Parameters:
url
- RPC url- Returns:
- inet socket address
- Throws:
Exception
- if the URL is invalid- See Also:
RpcSystemUtils.getRpcUrl(java.lang.String, int, java.lang.String, org.apache.flink.runtime.rpc.AddressResolution, org.apache.flink.configuration.Configuration)
-
getRpcUrl
public String getRpcUrl(String hostname, int port, String endpointName, AddressResolution addressResolution, Configuration config) throws UnknownHostException
Description copied from interface:RpcSystemUtils
Constructs an RPC URL for the given parameters, that can be used to connect to the targeted RpcService.- Specified by:
getRpcUrl
in interfaceRpcSystemUtils
- 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
-
getMaximumMessageSizeInBytes
public long getMaximumMessageSizeInBytes(Configuration config)
Description copied from interface:RpcSystemUtils
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.- Specified by:
getMaximumMessageSizeInBytes
in interfaceRpcSystemUtils
- Parameters:
config
- Flink configuration- Returns:
- maximum number of bytes that an RPC message may carry
-
-