public class AkkaRpcServiceUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AkkaRpcServiceUtils.AkkaProtocol
Whether to use TCP or encrypted TCP for Akka.
|
Modifier and Type | Method and Description |
---|---|
static String |
createRandomName(String prefix)
Creates a random name of the form prefix_X, where X is an increasing number.
|
static RpcService |
createRpcService(String hostname,
int port,
Configuration configuration)
Utility method to create RPC service from configuration and hostname, port.
|
static RpcService |
createRpcService(String hostname,
String portRangeDefinition,
Configuration configuration)
Utility method to create RPC service from configuration and hostname, port.
|
static long |
extractMaximumFramesize(Configuration configuration) |
static String |
getRpcUrl(String hostname,
int port,
String endpointName,
HighAvailabilityServicesUtils.AddressResolution addressResolution,
AkkaRpcServiceUtils.AkkaProtocol akkaProtocol) |
static String |
getRpcUrl(String hostname,
int port,
String endpointName,
HighAvailabilityServicesUtils.AddressResolution addressResolution,
Configuration config) |
public static RpcService createRpcService(String hostname, String portRangeDefinition, Configuration configuration) throws Exception
hostname
- The hostname/address that describes the TaskManager's data location.portRangeDefinition
- The port range to start TaskManager on.configuration
- The configuration for the TaskManager.IOException
- Thrown, if the actor system can not bind to the addressException
- Thrown is some other error occurs while creating akka actor systempublic static RpcService createRpcService(String hostname, int port, Configuration configuration) throws Exception
hostname
- The hostname/address that describes the TaskManager's data location.port
- If true, the TaskManager will not initiate the TCP network stack.configuration
- The configuration for the TaskManager.IOException
- Thrown, if the actor system can not bind to the addressException
- Thrown is some other error occurs while creating akka actor systempublic static String getRpcUrl(String hostname, int port, String endpointName, HighAvailabilityServicesUtils.AddressResolution addressResolution, Configuration config) throws UnknownHostException
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 static String getRpcUrl(String hostname, int port, String endpointName, HighAvailabilityServicesUtils.AddressResolution addressResolution, AkkaRpcServiceUtils.AkkaProtocol akkaProtocol) throws UnknownHostException
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.akkaProtocol
- True, if security/encryption is enabled, false otherwise.UnknownHostException
public static String createRandomName(String prefix)
prefix
- Prefix string to prepend to the monotonically increasing name offset numberpublic static long extractMaximumFramesize(Configuration configuration)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.