@InterfaceAudience.Private public final class ZKConfig extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZKConfig.ZKClusterKey |
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private static String |
VARIABLE_END |
private static int |
VARIABLE_END_LENGTH |
private static String |
VARIABLE_START |
private static int |
VARIABLE_START_LENGTH |
Modifier | Constructor and Description |
---|---|
private |
ZKConfig() |
Modifier and Type | Method and Description |
---|---|
static String |
buildZKQuorumServerString(String[] serverHosts,
String clientPort)
Build the ZK quorum server string with "server:clientport" list, separated by ','
|
static String |
getZKQuorumServersString(org.apache.hadoop.conf.Configuration conf)
Return the ZK Quorum servers string given the specified configuration.
|
private static String |
getZKQuorumServersString(Properties properties)
Return the ZK Quorum servers string given zk properties returned by
makeZKProps
|
private static String |
getZKQuorumServersStringFromHbaseConfig(org.apache.hadoop.conf.Configuration conf)
Return the ZK Quorum servers string given the specified configuration
|
static String |
getZooKeeperClusterKey(org.apache.hadoop.conf.Configuration conf)
Get the key to the ZK ensemble for this configuration without
adding a name at the end
|
static String |
getZooKeeperClusterKey(org.apache.hadoop.conf.Configuration conf,
String name)
Get the key to the ZK ensemble for this configuration and append
a name at the end
|
static Properties |
makeZKProps(org.apache.hadoop.conf.Configuration conf)
Make a Properties object holding ZooKeeper config.
|
private static Properties |
makeZKPropsFromHbaseConfig(org.apache.hadoop.conf.Configuration conf)
Make a Properties object holding ZooKeeper config.
|
private static Properties |
makeZKPropsFromZooCfg(org.apache.hadoop.conf.Configuration conf)
Parses the corresponding config options from the zoo.cfg file
and make a Properties object holding the Zookeeper config.
|
static Properties |
parseZooCfg(org.apache.hadoop.conf.Configuration conf,
InputStream inputStream)
Deprecated.
in 0.96 onwards. HBase will no longer rely on zoo.cfg
availability.
|
static String |
standardizeZKQuorumServerString(String quorumStringInput,
String clientPort)
Standardize the ZK quorum string: make it a "server:clientport" list, separated by ','
|
static ZKConfig.ZKClusterKey |
transformClusterKey(String key)
Separate the given key into the three configurations it should contain:
hbase.zookeeper.quorum, hbase.zookeeper.client.port
and zookeeper.znode.parent
|
static void |
validateClusterKey(String key)
Verifies that the given key matches the expected format for a ZooKeeper cluster key.
|
private static final org.apache.commons.logging.Log LOG
private static final String VARIABLE_START
private static final int VARIABLE_START_LENGTH
private static final String VARIABLE_END
private static final int VARIABLE_END_LENGTH
public static Properties makeZKProps(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration to read from.private static Properties makeZKPropsFromZooCfg(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration to read from.private static Properties makeZKPropsFromHbaseConfig(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration to read from.@Deprecated public static Properties parseZooCfg(org.apache.hadoop.conf.Configuration conf, InputStream inputStream) throws IOException
conf
- HBaseConfiguration to use for injecting variables.inputStream
- InputStream to read from.IOException
- if anything goes wrong parsing configprivate static String getZKQuorumServersString(Properties properties)
properties
- private static String getZKQuorumServersStringFromHbaseConfig(org.apache.hadoop.conf.Configuration conf)
conf
- public static String getZKQuorumServersString(org.apache.hadoop.conf.Configuration conf)
conf
- public static String buildZKQuorumServerString(String[] serverHosts, String clientPort)
serverHosts
- a list of servers for ZK quorumclientPort
- the default client portpublic static void validateClusterKey(String key) throws IOException
key
- the cluster key to validateIOException
- if the key could not be parsedpublic static ZKConfig.ZKClusterKey transformClusterKey(String key) throws IOException
key
- IOException
public static String getZooKeeperClusterKey(org.apache.hadoop.conf.Configuration conf)
conf
- Configuration to use to build the keypublic static String getZooKeeperClusterKey(org.apache.hadoop.conf.Configuration conf, String name)
conf
- Configuration to use to build the keyname
- Name that should be appended at the end if not empty or nullpublic static String standardizeZKQuorumServerString(String quorumStringInput, String clientPort)
quorumStringInput
- a string contains a list of servers for ZK quorumclientPort
- the default client portCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.