|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.conf.Configuration org.apache.oozie.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. |
String |
get(String name)
Get the value of the name property, null if
no such property exists. |
String |
get(String name,
String defaultValue)
Get the value of the name property. |
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, getBoolean, getClass, getClass, getClasses, getClassLoader, getConfResourceAsInputStream, getConfResourceAsReader, getEnum, getFile, getFloat, getInstances, getInt, getLocalPath, getLong, getRange, getRaw, getResource, getStringCollection, getStrings, getStrings, getValByRegex, iterator, main, readFields, reloadConfiguration, set, setBoolean, setBooleanIfUnset, setClass, setClassLoader, setEnum, setFloat, setIfUnset, setInt, setLong, setQuietMode, setStrings, size, toString, write, 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 Properties toProperties()
public String get(String name)
name
property, null
if
no such property exists.
Values are processed for variable expansion
before being returned.
get
in class org.apache.hadoop.conf.Configuration
name
- the property name.
name
property,
or null if no such property exists.public String get(String name, String defaultValue)
name
property. If no such property
exists, then defaultValue
is returned.
get
in class org.apache.hadoop.conf.Configuration
name
- property name.defaultValue
- default value.
defaultValue
if the property
doesn't exist.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |