|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.tools.rumen.state.StatePool
public class StatePool
A pool of states. States used by DataType's can be managed the
StatePool. StatePool also supports persistence. Persistence
is key to share states across multiple Anonymizer runs.
| Nested Class Summary | |
|---|---|
static class |
StatePool.StatePair
A wrapper class that binds the state implementation to its implementing class name. |
| Field Summary | |
|---|---|
static String |
DIR_CONFIG
|
static String |
PERSIST_CONFIG
|
static String |
RELOAD_CONFIG
|
| Constructor Summary | |
|---|---|
StatePool()
|
|
| Method Summary | |
|---|---|
void |
addState(Class id,
State state)
|
State |
getState(Class clazz)
|
HashMap<String,StatePool.StatePair> |
getStates()
To be invoked only by the Jackson JSON serializer. |
long |
getVersion()
To be invoked only by the Jackson JSON serializer. |
void |
initialize(org.apache.hadoop.conf.Configuration conf)
Initialized the StatePool. |
boolean |
isUpdated()
|
void |
persist()
Persists the current state to the state directory. |
void |
setStates(HashMap<String,StatePool.StatePair> states)
To be invoked only by the Jackson JSON deserializer. |
void |
setVersion(long version)
To be invoked only by the Jackson JSON deserializer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DIR_CONFIG
public static final String RELOAD_CONFIG
public static final String PERSIST_CONFIG
| Constructor Detail |
|---|
public StatePool()
| Method Detail |
|---|
public void addState(Class id,
State state)
public State getState(Class clazz)
public boolean isUpdated()
public void initialize(org.apache.hadoop.conf.Configuration conf)
throws Exception
StatePool. This API also reloads the previously
persisted state. Note that the StatePool should be initialized only
once.
Exception
public void persist()
throws IOException
IOExceptionpublic long getVersion()
public void setVersion(long version)
public HashMap<String,StatePool.StatePair> getStates()
public void setStates(HashMap<String,StatePool.StatePair> states)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||