@InterfaceAudience.Private public class CompoundConfiguration extends org.apache.hadoop.conf.Configuration
The iterator on CompoundConfiguration is unmodifiable. Obtaining iterator is an expensive operation.
For clarity: the shallow merge allows the user to mutate either of the configuration objects and have changes reflected everywhere. In contrast to a deep merge, that requires you to explicitly know all applicable copies to propagate changes. WARNING: The values set in the CompoundConfiguration are do not handle Property variable substitution. However, if they are set in the underlying configuration substitutions are done.
| Modifier and Type | Field and Description |
|---|---|
protected List<org.apache.hadoop.hbase.CompoundConfiguration.ImmutableConfigMap> |
configs |
| Constructor and Description |
|---|
CompoundConfiguration()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CompoundConfiguration |
add(org.apache.hadoop.conf.Configuration conf)
Add Hadoop Configuration object to config list.
|
CompoundConfiguration |
addStringMap(Map<String,String> map)
Add String map to config list.
|
CompoundConfiguration |
addWritableMap(Map<ImmutableBytesWritable,ImmutableBytesWritable> map)
Add ImmutableBytesWritable map to config list.
|
void |
clear()
These methods are unsupported, and no code using CompoundConfiguration depend upon them.
|
String |
get(String key) |
String |
get(String name,
String defaultValue)
Get the value of the
name. |
Class<?> |
getClassByName(String name) |
String |
getRaw(String key) |
Iterator<Map.Entry<String,String>> |
iterator() |
void |
set(String name,
String value) |
int |
size() |
String |
toString() |
void |
write(DataOutput out) |
void |
writeXml(OutputStream out) |
addDefaultResource, addResource, addResource, addResource, addResource, dumpConfiguration, getBoolean, getClass, getClass, getClasses, getClassLoader, getConfResourceAsInputStream, getConfResourceAsReader, getEnum, getFile, getFloat, getInstances, getInt, getLocalPath, getLong, getRange, getResource, getStringCollection, getStrings, getStrings, getValByRegex, main, readFields, reloadConfiguration, setBoolean, setBooleanIfUnset, setClass, setClassLoader, setEnum, setFloat, setIfUnset, setInt, setLong, setQuietMode, setStrings, unset, writeXmlprotected List<org.apache.hadoop.hbase.CompoundConfiguration.ImmutableConfigMap> configs
public CompoundConfiguration()
public CompoundConfiguration add(org.apache.hadoop.conf.Configuration conf)
conf - configuration objectpublic CompoundConfiguration addWritableMap(Map<ImmutableBytesWritable,ImmutableBytesWritable> map)
map - ImmutableBytesWritable mappublic CompoundConfiguration addStringMap(Map<String,String> map)
public String toString()
toString in class org.apache.hadoop.conf.Configurationpublic String getRaw(String key)
getRaw in class org.apache.hadoop.conf.Configurationpublic Class<?> getClassByName(String name) throws ClassNotFoundException
getClassByName in class org.apache.hadoop.conf.ConfigurationClassNotFoundExceptionpublic int size()
size in class org.apache.hadoop.conf.Configurationpublic String get(String name, String defaultValue)
name. If the key is deprecated,
it returns the value of the first key which replaces the deprecated key
and is not null.
If no such property exists,
then defaultValue is returned.
The CompooundConfiguration does not do property substitution. To do so we need
Configuration.getProps to be protected or package visible. Though in hadoop2 it is
protected, in hadoop1 the method is private and not accessible.
All of the get* methods call this overridden get method.get in class org.apache.hadoop.conf.Configurationname - property name.defaultValue - default value.defaultValue if the property
doesn't exist.public void set(String name, String value)
set in class org.apache.hadoop.conf.Configurationpublic void clear()
clear in class org.apache.hadoop.conf.Configurationpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.Writablewrite in class org.apache.hadoop.conf.ConfigurationIOExceptionpublic void writeXml(OutputStream out) throws IOException
writeXml in class org.apache.hadoop.conf.ConfigurationIOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.