org.apache.hadoop.hbase
Class HBaseConfiguration

java.lang.Object
  extended by org.apache.hadoop.conf.Configuration
      extended by org.apache.hadoop.hbase.HBaseConfiguration
All Implemented Interfaces:
Iterable<Map.Entry<String,String>>, org.apache.hadoop.io.Writable

@InterfaceAudience.Public
@InterfaceStability.Stable
public class HBaseConfiguration
extends org.apache.hadoop.conf.Configuration

Adds HBase configuration files to a Configuration


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.conf.Configuration
org.apache.hadoop.conf.Configuration.IntegerRanges
 
Constructor Summary
HBaseConfiguration()
          Deprecated. 
HBaseConfiguration(org.apache.hadoop.conf.Configuration c)
          Deprecated. 
 
Method Summary
static org.apache.hadoop.conf.Configuration addHbaseResources(org.apache.hadoop.conf.Configuration conf)
           
static org.apache.hadoop.conf.Configuration create()
          Creates a Configuration with HBase resources
static org.apache.hadoop.conf.Configuration create(org.apache.hadoop.conf.Configuration that)
           
static int getInt(org.apache.hadoop.conf.Configuration conf, String name, String deprecatedName, int defaultValue)
          Get the value of the name property as an int, possibly referring to the deprecated name of the configuration property.
static String getPassword(org.apache.hadoop.conf.Configuration conf, String alias, String defPass)
          Get the password from the Configuration instance using the getPassword method if it exists.
static boolean isShowConfInServlet()
           
static void main(String[] args)
          For debugging.
static void merge(org.apache.hadoop.conf.Configuration destConf, org.apache.hadoop.conf.Configuration srcConf)
          Merge two configurations.
 
Methods inherited from class org.apache.hadoop.conf.Configuration
addDefaultResource, addDeprecation, addDeprecation, addDeprecation, addDeprecation, addResource, addResource, addResource, addResource, addResource, clear, dumpConfiguration, dumpDeprecatedKeys, get, get, getBoolean, getClass, getClass, getClassByName, getClassByNameOrNull, getClasses, getClassLoader, getConfResourceAsInputStream, getConfResourceAsReader, getDouble, getEnum, getFile, getFloat, getInstances, getInt, getInts, getLocalPath, getLong, getLongBytes, getPattern, getPropertySources, getProps, getRange, getRaw, getResource, getSocketAddr, getStringCollection, getStrings, getStrings, getTimeDuration, getTrimmed, getTrimmed, getTrimmedStringCollection, getTrimmedStrings, getTrimmedStrings, getValByRegex, isDeprecated, iterator, readFields, reloadConfiguration, set, set, setBoolean, setBooleanIfUnset, setClass, setClassLoader, setDouble, setEnum, setFloat, setIfUnset, setInt, setLong, setPattern, setQuietMode, setSocketAddr, setStrings, setTimeDuration, size, toString, unset, updateConnectAddr, write, writeXml, writeXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HBaseConfiguration

@Deprecated
public HBaseConfiguration()
Deprecated. 

Instantinating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration


HBaseConfiguration

@Deprecated
public HBaseConfiguration(org.apache.hadoop.conf.Configuration c)
Deprecated. 

Instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create(conf) to construct a plain Configuration

Method Detail

addHbaseResources

public static org.apache.hadoop.conf.Configuration addHbaseResources(org.apache.hadoop.conf.Configuration conf)

create

public static org.apache.hadoop.conf.Configuration create()
Creates a Configuration with HBase resources

Returns:
a Configuration with HBase resources

create

public static org.apache.hadoop.conf.Configuration create(org.apache.hadoop.conf.Configuration that)
Parameters:
that - Configuration to clone.
Returns:
a Configuration created with the hbase-*.xml files plus the given configuration.

merge

public static void merge(org.apache.hadoop.conf.Configuration destConf,
                         org.apache.hadoop.conf.Configuration srcConf)
Merge two configurations.

Parameters:
destConf - the configuration that will be overwritten with items from the srcConf
srcConf - the source configuration

isShowConfInServlet

public static boolean isShowConfInServlet()
Returns:
whether to show HBase Configuration in servlet

getInt

public static int getInt(org.apache.hadoop.conf.Configuration conf,
                         String name,
                         String deprecatedName,
                         int defaultValue)
Get the value of the name property as an int, possibly referring to the deprecated name of the configuration property. If no such property exists, the provided default value is returned, or if the specified value is not a valid int, then an error is thrown.

Parameters:
name - property name.
deprecatedName - a deprecatedName for the property to use if non-deprecated name is not used
defaultValue - default value.
Returns:
property value as an int, or defaultValue.
Throws:
NumberFormatException - when the value is invalid

getPassword

public static String getPassword(org.apache.hadoop.conf.Configuration conf,
                                 String alias,
                                 String defPass)
                          throws IOException
Get the password from the Configuration instance using the getPassword method if it exists. If not, then fall back to the general get method for configuration elements.

Parameters:
conf - configuration instance for accessing the passwords
alias - the name of the password element
defPass - the default password
Returns:
String password or default password
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
For debugging. Dump configurations to system output as xml format. Master and RS configurations can also be dumped using http services. e.g. "curl http://master:60010/dump"

Throws:
Exception


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