T - type of Statepublic abstract class AbstractRedisStateUpdater<T extends State> extends BaseStateUpdater<T>
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)
storeMapper - mapper for storingpublic void setExpireInterval(int expireIntervalSec)
expireIntervalSec - time to live in secondspublic void updateState(T state, List<TridentTuple> inputs, TridentCollector collector)
Copyright © 2023 The Apache Software Foundation. All rights reserved.