public abstract class AbstractKeyStateBackend extends Object implements StateStoreManager
State value modification is not thread safe! By default, every processing thread has its own space to handle state.
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,KeyValueStore<String,Map<Long,byte[]>>> |
backStorageCache
tablename, KeyValueStore key, checkpointId, content
|
protected long |
currentCheckpointId |
protected Object |
currentKey |
protected Set<String> |
descNamespace |
protected int |
keyGroupIndex |
protected Map<String,ListStateStoreManagerProxy> |
listManagerProxyHashMap |
protected Map<String,MapStateStoreManagerProxy> |
mapManagerProxyHashMap |
protected Map<String,ValueStateStoreManagerProxy> |
valueManagerProxyHashMap |
| Constructor and Description |
|---|
AbstractKeyStateBackend(AbstractStateBackend backend) |
| Modifier and Type | Method and Description |
|---|---|
void |
ackCommit(long checkpointId,
long timeStamp)
The ackCommit method is used for cleaning the last checkpoint, and must be called after commit
in the same thread.
|
void |
commit(long checkpointId)
The commit method is used for persistent, and can be used in another thread to reach async
state commit.
|
void |
finish(long checkpointId)
The finish method is used when the batched data is all saved in state.
|
<K,T> T |
get(AbstractStateDescriptor descriptor,
K key) |
AbstractStateBackend |
getBackend() |
BackendType |
getBackendType() |
KeyValueStore<String,Map<Long,byte[]>> |
getBackStorage(AbstractStateDescriptor stateDescriptor) |
KeyValueStore<String,Map<Long,byte[]>> |
getBackStorage(String tableName) |
long |
getCheckpointId() |
Object |
getCurrentKey() |
int |
getKeyGroupIndex() |
StateStrategy |
getStateStrategy() |
<K,T> void |
put(AbstractStateDescriptor descriptor,
K key,
T value) |
void |
rollBack(long checkpointId)
The rollback method is used for recovering the checkpoint.
|
void |
setCheckpointId(long checkpointId) |
void |
setContext(long checkpointId,
Object currentKey) |
abstract void |
setCurrentKey(Object currentKey) |
void |
setKeyGroupIndex(int keyGroupIndex) |
protected long currentCheckpointId
protected Object currentKey
protected int keyGroupIndex
protected Map<String,ValueStateStoreManagerProxy> valueManagerProxyHashMap
protected Map<String,ListStateStoreManagerProxy> listManagerProxyHashMap
protected Map<String,MapStateStoreManagerProxy> mapManagerProxyHashMap
public AbstractKeyStateBackend(AbstractStateBackend backend)
public <K,T> void put(AbstractStateDescriptor descriptor, K key, T value)
public <K,T> T get(AbstractStateDescriptor descriptor, K key)
public void finish(long checkpointId)
StateStoreManagerfinish in interface StateStoreManagerpublic void commit(long checkpointId)
StateStoreManagercommit in interface StateStoreManagerpublic void ackCommit(long checkpointId,
long timeStamp)
StateStoreManagerackCommit in interface StateStoreManagerpublic void rollBack(long checkpointId)
StateStoreManagerrollBack in interface StateStoreManagerpublic KeyValueStore<String,Map<Long,byte[]>> getBackStorage(String tableName)
public KeyValueStore<String,Map<Long,byte[]>> getBackStorage(AbstractStateDescriptor stateDescriptor)
public StateStrategy getStateStrategy()
public BackendType getBackendType()
public Object getCurrentKey()
public abstract void setCurrentKey(Object currentKey)
public long getCheckpointId()
public void setCheckpointId(long checkpointId)
public void setContext(long checkpointId,
Object currentKey)
public AbstractStateBackend getBackend()
public int getKeyGroupIndex()
public void setKeyGroupIndex(int keyGroupIndex)
Copyright © 2020. All rights reserved.