public class StatePool extends Object
DataType
's can be managed the
StatePool
. StatePool
also supports persistence. Persistence
is key to share states across multiple Anonymizer
runs.Modifier and Type | Class and Description |
---|---|
static class |
StatePool.StatePair
A wrapper class that binds the state implementation to its implementing
class name.
|
Modifier and Type | Field and Description |
---|---|
static String |
DIR_CONFIG |
static String |
PERSIST_CONFIG |
static String |
RELOAD_CONFIG |
Constructor and Description |
---|
StatePool() |
Modifier and Type | Method and Description |
---|---|
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(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.
|
public static final String DIR_CONFIG
public static final String RELOAD_CONFIG
public static final String PERSIST_CONFIG
public boolean isUpdated()
public void initialize(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
IOException
public long getVersion()
public void setVersion(long version)
public HashMap<String,StatePool.StatePair> getStates()
public void setStates(HashMap<String,StatePool.StatePair> states)
Copyright © 2013 Apache Software Foundation. All rights reserved.