|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.flume.Context
public class Context
The context is a key-value store used to pass configuration information throughout the system.
| Constructor Summary | |
|---|---|
Context()
|
|
Context(Map<String,String> paramters)
|
|
| Method Summary | |
|---|---|
void |
clear()
Removes all of the mappings from this map. |
Boolean |
getBoolean(String key)
Gets value mapped to key, returning null if unmapped. |
Boolean |
getBoolean(String key,
Boolean defaultValue)
Gets value mapped to key, returning defaultValue if unmapped. |
Integer |
getInteger(String key)
Gets value mapped to key, returning null if unmapped. |
Integer |
getInteger(String key,
Integer defaultValue)
Gets value mapped to key, returning defaultValue if unmapped. |
Long |
getLong(String key)
Gets value mapped to key, returning null if unmapped. |
Long |
getLong(String key,
Long defaultValue)
Gets value mapped to key, returning defaultValue if unmapped. |
com.google.common.collect.ImmutableMap<String,String> |
getParameters()
Gets a copy of the backing map structure. |
String |
getString(String key)
Gets value mapped to key, returning null if unmapped. |
String |
getString(String key,
String defaultValue)
Gets value mapped to key, returning defaultValue if unmapped. |
com.google.common.collect.ImmutableMap<String,String> |
getSubProperties(String prefix)
Get properties which start with a prefix. |
void |
put(String key,
String value)
Associates the specified value with the specified key in this context. |
void |
putAll(Map<String,String> map)
Associates all of the given map's keys and values in the Context. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Context()
public Context(Map<String,String> paramters)
| Method Detail |
|---|
public com.google.common.collect.ImmutableMap<String,String> getParameters()
public void clear()
public com.google.common.collect.ImmutableMap<String,String> getSubProperties(String prefix)
{ hdfs.key = value, otherKey = otherValue }
this method will return a map containing:
{ key = value}
Note: The prefix must end with a period character. If not
this method will raise an IllegalArgumentException.
prefix - key prefix to find and remove from keys in resulting map
IllegalArguemntException - if the given prefix does not end with
a period character.public void putAll(Map<String,String> map)
public void put(String key,
String value)
key - key with which the specified value is to be associatedvalue - to be associated with the specified key
public Boolean getBoolean(String key,
Boolean defaultValue)
key - to be founddefaultValue - returned if key is unmapped
public Boolean getBoolean(String key)
Note that this method returns an object as opposed to a
primitive. The configuration key requested may not be mapped
to a value and by returning the primitive object wrapper we can
return null. If the key does not exist the return value of
this method is assigned directly to a primitive, a
NullPointerException will be thrown.
key - to be found
public Integer getInteger(String key,
Integer defaultValue)
key - to be founddefaultValue - returned if key is unmapped
public Integer getInteger(String key)
Note that this method returns an object as opposed to a
primitive. The configuration key requested may not be mapped
to a value and by returning the primitive object wrapper we can
return null. If the key does not exist the return value of
this method is assigned directly to a primitive, a
NullPointerException will be thrown.
key - to be found
public Long getLong(String key,
Long defaultValue)
key - to be founddefaultValue - returned if key is unmapped
public Long getLong(String key)
Note that this method returns an object as opposed to a
primitive. The configuration key requested may not be mapped
to a value and by returning the primitive object wrapper we can
return null. If the key does not exist the return value of
this method is assigned directly to a primitive, a
NullPointerException will be thrown.
key - to be found
public String getString(String key,
String defaultValue)
key - to be founddefaultValue - returned if key is unmapped
public String getString(String key)
key - to be found
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||