org.apache.hadoop.hbase.zookeeper
Class ZKConfig

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZKConfig

@InterfaceAudience.Private
public class ZKConfig
extends Object

Utility methods for reading, and building the ZooKeeper configuration.


Constructor Summary
ZKConfig()
           
 
Method Summary
static String getZKQuorumServersString(org.apache.hadoop.conf.Configuration conf)
          Return the ZK Quorum servers string given the specified configuration.
static String getZKQuorumServersString(Properties properties)
          Return the ZK Quorum servers string given zk properties returned by makeZKProps
static Properties makeZKProps(org.apache.hadoop.conf.Configuration conf)
          Make a Properties object holding 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZKConfig

public ZKConfig()
Method Detail

makeZKProps

public static Properties makeZKProps(org.apache.hadoop.conf.Configuration conf)
Make a Properties object holding ZooKeeper config. Parses the corresponding config options from the HBase XML configs and generates the appropriate ZooKeeper properties.

Parameters:
conf - Configuration to read from.
Returns:
Properties holding mappings representing ZooKeeper config file.

parseZooCfg

@Deprecated
public static Properties parseZooCfg(org.apache.hadoop.conf.Configuration conf,
                                                InputStream inputStream)
                              throws IOException
Deprecated. in 0.96 onwards. HBase will no longer rely on zoo.cfg availability.

Parse ZooKeeper's zoo.cfg, injecting HBase Configuration variables in. This method is used for testing so we can pass our own InputStream.

Parameters:
conf - HBaseConfiguration to use for injecting variables.
inputStream - InputStream to read from.
Returns:
Properties parsed from config stream with variables substituted.
Throws:
IOException - if anything goes wrong parsing config

getZKQuorumServersString

public static String getZKQuorumServersString(Properties properties)
Return the ZK Quorum servers string given zk properties returned by makeZKProps

Parameters:
properties -
Returns:
Quorum servers String

getZKQuorumServersString

public static String getZKQuorumServersString(org.apache.hadoop.conf.Configuration conf)
Return the ZK Quorum servers string given the specified configuration.

Parameters:
conf -
Returns:
Quorum servers


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.