public class HBaseConfigurationSource extends java.lang.Object implements ConfigurationSource
unwrapDelegate()
Constructor and Description |
---|
HBaseConfigurationSource(org.apache.hadoop.conf.Configuration delegate) |
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(java.lang.String key,
boolean deflt)
Get the value from this configuration source set by the given
key
or deflt if no value exists for that key. |
double |
getDouble(java.lang.String key,
double deflt)
Get the value from this configuration source set by the given
key
or deflt if no value exists for that key. |
int |
getInt(java.lang.String key,
int deflt)
Get the value from this configuration source set by the given
key
or deflt if no value exists for that key. |
long |
getLong(java.lang.String key,
long deflt)
Get the value from this configuration source set by the given
key
or deflt if no value exists for that key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String deflt)
Get the value from this configuration source set by the given
key
or deflt if no value exists for that key. |
java.util.Map<java.lang.String,java.lang.String> |
prefixMatch(java.lang.String prefix)
Get the mapping of property key to (toString()) value for configuration properties
that start with the given prefix.
If null is passed as an argument, all properties are returned. |
org.apache.hadoop.conf.Configuration |
unwrapDelegate()
Since everything under us, HBase, Spark, Hadoop, etc., uses
Configuration ,
we must expose a way to get the configured delegate. |
public HBaseConfigurationSource(org.apache.hadoop.conf.Configuration delegate)
public int getInt(java.lang.String key, int deflt)
ConfigurationSource
key
or deflt
if no value exists for that key.getInt
in interface ConfigurationSource
key
- the property keydeflt
- the default value to return if no value exists for the given keypublic long getLong(java.lang.String key, long deflt)
ConfigurationSource
key
or deflt
if no value exists for that key.getLong
in interface ConfigurationSource
key
- the property keydeflt
- the default value to return if no value exists for the given keypublic boolean getBoolean(java.lang.String key, boolean deflt)
ConfigurationSource
key
or deflt
if no value exists for that key.getBoolean
in interface ConfigurationSource
key
- the property keydeflt
- the default value to return if no value exists for the given keypublic java.lang.String getString(java.lang.String key, java.lang.String deflt)
ConfigurationSource
key
or deflt
if no value exists for that key.getString
in interface ConfigurationSource
key
- the property keydeflt
- the default value to return if no value exists for the given keypublic double getDouble(java.lang.String key, double deflt)
ConfigurationSource
key
or deflt
if no value exists for that key.getDouble
in interface ConfigurationSource
key
- the property keydeflt
- the default value to return if no value exists for the given keypublic java.util.Map<java.lang.String,java.lang.String> prefixMatch(java.lang.String prefix)
ConfigurationSource
null
is passed as an argument, all properties are returned.
To get all splice DDL properties, for example:
Mapprops = config.prefixMatch("splice.ddl*");
prefixMatch
in interface ConfigurationSource
prefix
- the property's starting keyprefix
.public org.apache.hadoop.conf.Configuration unwrapDelegate()
Configuration
,
we must expose a way to get the configured delegate.
This method is not exposed in the interface, of course, because it would create a
compile-time dependency on Configuration
. Given that, it's a little convoluted
to call this method. It's assumed that callers have access to this method can also
support a compile-time dependency on the hadoop configuration.
Example:
Configuration config = ((HBaseConfigurationSource)HConfiguration.getConfigSource()).unwrapDelegate()
unwrapDelegate
in interface ConfigurationSource