public class StatePool
extends java.lang.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 | Description |
|---|---|---|
static class |
StatePool.StatePair |
A wrapper class that binds the state implementation to its implementing
class name.
|
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DIR_CONFIG |
|
static java.lang.String |
PERSIST_CONFIG |
|
static java.lang.String |
RELOAD_CONFIG |
| Constructor | Description |
|---|---|
StatePool() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addState(java.lang.Class id,
State state) |
|
State |
getState(java.lang.Class clazz) |
|
java.util.HashMap<java.lang.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(java.util.HashMap<java.lang.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 java.lang.String DIR_CONFIG
public static final java.lang.String RELOAD_CONFIG
public static final java.lang.String PERSIST_CONFIG
public void addState(java.lang.Class id,
State state)
public State getState(java.lang.Class clazz)
public boolean isUpdated()
public void initialize(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
StatePool. This API also reloads the previously
persisted state. Note that the StatePool should be initialized only
once.java.lang.Exceptionpublic void persist()
throws java.io.IOException
java.io.IOExceptionpublic long getVersion()
public void setVersion(long version)
public java.util.HashMap<java.lang.String,StatePool.StatePair> getStates()
public void setStates(java.util.HashMap<java.lang.String,StatePool.StatePair> states)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.