public class AkkaRpcSystem extends Object implements RpcSystem
RpcSystem
implementation based on Akka.RpcSystem.FixedThreadPoolExecutorConfiguration, RpcSystem.ForkJoinExecutorConfiguration, RpcSystem.RpcServiceBuilder
Constructor and Description |
---|
AkkaRpcSystem() |
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
getInetSocketAddressFromRpcUrl(String url)
Returns an
InetSocketAddress 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 an
RpcService that is only reachable from the local machine. |
RpcSystem.RpcServiceBuilder |
remoteServiceBuilder(Configuration configuration,
String externalAddress,
String externalPortRange)
Returns a builder for an
RpcService that is reachable from other machines. |
public RpcSystem.RpcServiceBuilder localServiceBuilder(Configuration configuration)
RpcSystem
RpcService
that is only reachable from the local machine.localServiceBuilder
in interface RpcSystem
configuration
- Flink configurationpublic RpcSystem.RpcServiceBuilder remoteServiceBuilder(Configuration configuration, @Nullable String externalAddress, String externalPortRange)
RpcSystem
RpcService
that is reachable from other machines.remoteServiceBuilder
in interface RpcSystem
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 reachablepublic InetSocketAddress getInetSocketAddressFromRpcUrl(String url) throws Exception
RpcSystemUtils
InetSocketAddress
corresponding to the given RPC url.getInetSocketAddressFromRpcUrl
in interface RpcSystemUtils
url
- 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 String getRpcUrl(String hostname, int port, String endpointName, AddressResolution addressResolution, Configuration config) throws UnknownHostException
RpcSystemUtils
getRpcUrl
in interface RpcSystemUtils
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.UnknownHostException
public long getMaximumMessageSizeInBytes(Configuration config)
RpcSystemUtils
Long.MAX_VALUE
should be returned.getMaximumMessageSizeInBytes
in interface RpcSystemUtils
config
- Flink configurationCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.