@InterfaceAudience.Public @InterfaceStability.Stable public class HBaseConfiguration extends Configuration
Constructor and Description |
---|
HBaseConfiguration()
Deprecated.
|
HBaseConfiguration(Configuration c)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Configuration |
addHbaseResources(Configuration conf) |
static Configuration |
create()
Creates a Configuration with HBase resources
|
static Configuration |
create(Configuration that) |
static Configuration |
createClusterConf(Configuration baseConf,
String clusterKey)
Generates a
Configuration instance by applying the ZooKeeper cluster key
to the base Configuration. |
static Configuration |
createClusterConf(Configuration baseConf,
String clusterKey,
String overridePrefix)
Generates a
Configuration instance by applying property overrides prefixed by
a cluster profile key to the base Configuration. |
static int |
getInt(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(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(Configuration destConf,
Configuration srcConf)
Merge two configurations.
|
static void |
setWithPrefix(Configuration conf,
String prefix,
Iterable<Map.Entry<String,String>> properties)
Sets all the entries in the provided
Map<String, String> as properties in the
given Configuration . |
static Configuration |
subset(Configuration srcConf,
String prefix)
Returns a subset of the configuration properties, matching the given key prefix.
|
@Deprecated public HBaseConfiguration()
@Deprecated public HBaseConfiguration(Configuration c)
public static Configuration addHbaseResources(Configuration conf)
public static Configuration create()
public static Configuration create(Configuration that)
that
- Configuration to clone.public static void merge(Configuration destConf, Configuration srcConf)
destConf
- the configuration that will be overwritten with items
from the srcConfsrcConf
- the source configurationpublic static Configuration subset(Configuration srcConf, String prefix)
public static void setWithPrefix(Configuration conf, String prefix, Iterable<Map.Entry<String,String>> properties)
Map<String, String>
as properties in the
given Configuration
. Each property will have the specified prefix prepended,
so that the configuration entries are keyed by prefix + entry.getKey()
.public static boolean isShowConfInServlet()
public static int getInt(Configuration conf, String name, String deprecatedName, int defaultValue)
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.name
- property name.deprecatedName
- a deprecatedName for the property to use
if non-deprecated name is not useddefaultValue
- default value.int
,
or defaultValue
.NumberFormatException
- when the value is invalidpublic static String getPassword(Configuration conf, String alias, String defPass) throws IOException
conf
- configuration instance for accessing the passwordsalias
- the name of the password elementdefPass
- the default passwordIOException
public static Configuration createClusterConf(Configuration baseConf, String clusterKey) throws IOException
Configuration
instance by applying the ZooKeeper cluster key
to the base Configuration. Note that additional configuration properties may be needed
for a remote cluster, so it is preferable to use
createClusterConf(Configuration, String, String)
.baseConf
- the base configuration to use, containing prefixed override propertiesclusterKey
- the ZooKeeper quorum cluster key to apply, or null
if noneIOException
createClusterConf(Configuration, String, String)
public static Configuration createClusterConf(Configuration baseConf, String clusterKey, String overridePrefix) throws IOException
Configuration
instance by applying property overrides prefixed by
a cluster profile key to the base Configuration. Override properties are extracted by
the subset(Configuration, String)
method, then the merged on top of the base
Configuration and returned.baseConf
- the base configuration to use, containing prefixed override propertiesclusterKey
- the ZooKeeper quorum cluster key to apply, or null
if noneoverridePrefix
- the property key prefix to match for override properties,
or null
if noneIOException