public final class ConfigurationUtils extends Object
Modifier and Type | Method and Description |
---|---|
static float |
checkRatio(AlluxioConfiguration conf,
PropertyKey key)
Checks that the given property key is a ratio from 0.0 and 1.0, throwing an exception if it is
not.
|
static List<InetSocketAddress> |
getEmbeddedJournalAddresses(AlluxioConfiguration conf,
NetworkAddressUtils.ServiceType serviceType)
Gets the embedded journal addresses to use for the given service type (either master-raft or
job-master-raft).
|
static List<InetSocketAddress> |
getJobMasterEmbeddedJournalAddresses(AlluxioConfiguration conf) |
static String |
getJobMasterHostNotConfiguredMessage(String serviceName)
Returns a unified message for cases when the job master hostname cannot be determined.
|
static List<InetSocketAddress> |
getJobMasterRpcAddresses(AlluxioConfiguration conf)
Gets the RPC addresses of all job masters based on the configuration.
|
static List<InetSocketAddress> |
getMasterEmbeddedJournalAddresses(AlluxioConfiguration conf) |
static Set<String> |
getMasterHostnames(AlluxioConfiguration conf)
Gets list of masters in conf directory.
|
static String |
getMasterHostNotConfiguredMessage(String serviceName)
Returns a unified message for cases when the master hostname cannot be determined.
|
static List<InetSocketAddress> |
getMasterRpcAddresses(AlluxioConfiguration conf)
Gets the RPC addresses of all masters based on the configuration.
|
static String |
getSchemeAuthority(AlluxioConfiguration conf) |
static Set<String> |
getServerHostnames(AlluxioConfiguration conf)
Gets list of masters/workers in conf directory.
|
static Set<String> |
getWorkerHostnames(AlluxioConfiguration conf)
Gets list of workers in conf directory.
|
static boolean |
isHaMode(AlluxioConfiguration conf) |
static boolean |
jobMasterHostConfigured(AlluxioConfiguration conf) |
static boolean |
masterHostConfigured(AlluxioConfiguration conf) |
static List<InetSocketAddress> |
overridePort(List<InetSocketAddress> addrs,
int port)
Overrides the port in addresses.
|
static List<String> |
parseAsList(String value,
String delimiter)
Returns the input string as a list, splitting on a specified delimiter.
|
static List<InetSocketAddress> |
parseInetSocketAddresses(List<String> addresses) |
static String |
valueAsString(String value) |
public static List<InetSocketAddress> getEmbeddedJournalAddresses(AlluxioConfiguration conf, NetworkAddressUtils.ServiceType serviceType)
conf
- configurationserviceType
- the service to get addresses forpublic static List<InetSocketAddress> getMasterEmbeddedJournalAddresses(AlluxioConfiguration conf)
conf
- configurationpublic static List<InetSocketAddress> getJobMasterEmbeddedJournalAddresses(AlluxioConfiguration conf)
conf
- configurationpublic static List<InetSocketAddress> getMasterRpcAddresses(AlluxioConfiguration conf)
conf
- the configuration to usepublic static List<InetSocketAddress> getJobMasterRpcAddresses(AlluxioConfiguration conf)
conf
- the configuration to usepublic static List<InetSocketAddress> overridePort(List<InetSocketAddress> addrs, int port)
addrs
- the addressesport
- the new portpublic static List<InetSocketAddress> parseInetSocketAddresses(List<String> addresses)
addresses
- a list of address strings in the form "hostname:port"public static boolean jobMasterHostConfigured(AlluxioConfiguration conf)
conf
- the configuration to usepublic static String getMasterHostNotConfiguredMessage(String serviceName)
serviceName
- the name of the service that couldn't run. i.e. Alluxio worker, fsadmin
shell, etc.public static String getJobMasterHostNotConfiguredMessage(String serviceName)
serviceName
- the name of the service that couldn't run. i.e. Alluxio worker, fsadmin
shell, etc.public static float checkRatio(AlluxioConfiguration conf, PropertyKey key)
conf
- the configuration for looking up the property keykey
- the property keypublic static boolean masterHostConfigured(AlluxioConfiguration conf)
conf
- the configuration to usepublic static boolean isHaMode(AlluxioConfiguration conf)
conf
- the configuration usepublic static String valueAsString(String value)
value
- the value or null (value is not set)public static String getSchemeAuthority(AlluxioConfiguration conf)
conf
- the configurationpublic static List<String> parseAsList(String value, String delimiter)
value
- the value to splitdelimiter
- the delimiter to split the valuespublic static Set<String> getMasterHostnames(AlluxioConfiguration conf)
conf
- configurationpublic static Set<String> getWorkerHostnames(AlluxioConfiguration conf)
conf
- configurationpublic static Set<String> getServerHostnames(AlluxioConfiguration conf)
conf
- configurationCopyright © 2023. All Rights Reserved.