|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.conf.Configuration
com.cloudera.lib.util.XConfiguration
public class XConfiguration
Extends Hadoop Configuration providing a new constructor which reads an XML configuration from an InputStream.
OConfiguration(InputStream is).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.hadoop.conf.Configuration |
---|
org.apache.hadoop.conf.Configuration.IntegerRanges |
Constructor Summary | |
---|---|
XConfiguration()
Create an empty configuration. |
|
XConfiguration(InputStream is)
Create a configuration from an InputStream. |
|
XConfiguration(Properties props)
Create an configuration from a Properties instance. |
|
XConfiguration(Reader reader)
Create a configuration from an Reader. |
Method Summary | |
---|---|
static void |
copy(org.apache.hadoop.conf.Configuration source,
org.apache.hadoop.conf.Configuration target)
Copy configuration key/value pairs from one configuration to another if a property exists in the target, it gets replaced. |
Class<?> |
getClassByName(String name)
This is a stop gap fix for HADOOP-4416. |
static void |
injectDefaults(org.apache.hadoop.conf.Configuration source,
org.apache.hadoop.conf.Configuration target)
Injects configuration key/value pairs from one configuration to another if the key does not exist in the target configuration. |
XConfiguration |
resolve()
Returns a new XConfiguration instance with all inline values resolved. |
Properties |
toProperties()
Return a Properties instance with the configuration properties. |
String |
toXmlString()
Return a string with the configuration in XML format. |
String |
toXmlString(boolean prolog)
|
XConfiguration |
trim()
Returns a new XConfiguration with all values trimmed. |
Methods inherited from class org.apache.hadoop.conf.Configuration |
---|
addDefaultResource, addResource, addResource, addResource, addResource, clear, dumpConfiguration, get, get, getBoolean, getClass, getClass, getClasses, getClassLoader, getConfResourceAsInputStream, getConfResourceAsReader, getEnum, getFile, getFloat, getInstances, getInt, getLocalPath, getLong, getPattern, getRange, getRaw, getResource, getStringCollection, getStrings, getStrings, getTrimmed, getTrimmedStringCollection, getTrimmedStrings, getTrimmedStrings, getValByRegex, iterator, main, readFields, reloadConfiguration, set, setBoolean, setBooleanIfUnset, setClass, setClassLoader, setEnum, setFloat, setIfUnset, setInt, setLong, setPattern, setQuietMode, setStrings, size, toString, write, writeXml, writeXml |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XConfiguration()
public XConfiguration(InputStream is) throws IOException
Configuration.loadResource()
.
is
- inputstream to read the configuration from.
IOException
- thrown if the configuration could not be read.public XConfiguration(Reader reader) throws IOException
Configuration.loadResource()
.
reader
- reader to read the configuration from.
IOException
- thrown if the configuration could not be read.public XConfiguration(Properties props)
props
- Properties instance to get all properties from.Method Detail |
---|
public Class<?> getClassByName(String name) throws ClassNotFoundException
getClassByName
in class org.apache.hadoop.conf.Configuration
ClassNotFoundException
public static void copy(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target)
source
- source configuration.target
- target configuration.public static void injectDefaults(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target)
source
- source configuration.target
- target configuration.public XConfiguration trim()
public XConfiguration resolve()
public String toXmlString()
public String toXmlString(boolean prolog)
public Properties toProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |