public abstract class AbstractRedisStateUpdater<T extends State> extends BaseStateUpdater<T>
AbstractRedisStateUpdater is base class of any RedisStateUpdater, which implements BaseStateUpdater.
Derived classes should provide how to update (key, value) pairs to Redis, and AbstractRedisStateUpdater takes care of rest things.
| Modifier and Type | Field and Description |
|---|---|
protected String |
additionalKey |
protected RedisDataTypeDescription.RedisDataType |
dataType |
protected int |
expireIntervalSec |
| Constructor and Description |
|---|
AbstractRedisStateUpdater(RedisStoreMapper storeMapper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setExpireInterval(int expireIntervalSec)
Sets expire (time to live) if needed.
|
void |
updateState(T state,
List<TridentTuple> inputs,
TridentCollector collector) |
protected abstract void |
updateStatesToRedis(T state,
Map<String,String> keyToValue)
Updates (key, value) pairs to Redis.
|
cleanup, prepareprotected final RedisDataTypeDescription.RedisDataType dataType
protected final String additionalKey
protected int expireIntervalSec
public AbstractRedisStateUpdater(RedisStoreMapper storeMapper)
Constructor.
storeMapper - mapper for storingpublic void setExpireInterval(int expireIntervalSec)
Sets expire (time to live) if needed.
expireIntervalSec - time to live in secondspublic void updateState(T state, List<TridentTuple> inputs, TridentCollector collector)
Copyright © 2021 The Apache Software Foundation. All rights reserved.