Class AbstractTtlDecorator<T>
- java.lang.Object
-
- org.apache.flink.runtime.state.ttl.AbstractTtlDecorator<T>
-
- Type Parameters:
T
- Type of originally wrapped object
- Direct Known Subclasses:
TtlAggregateFunction
,TtlReduceFunction
public abstract class AbstractTtlDecorator<T> extends Object
Base class for TTL logic wrappers.
-
-
Field Summary
Fields Modifier and Type Field Description protected StateTtlConfig
config
protected T
original
Wrapped original state handler.protected boolean
returnExpired
Whether to renew expiration timestamp on state read access.protected TtlTimeProvider
timeProvider
protected long
ttl
State value time to live in milliseconds.protected boolean
updateTsOnRead
Whether to renew expiration timestamp on state read access.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTtlDecorator(T original, StateTtlConfig config, TtlTimeProvider timeProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> boolean
expired(TtlValue<V> ttlValue)
protected <T> T
getElementWithTtlCheck(TtlValue<T> ttlValue)
<V> V
getUnexpired(TtlValue<V> ttlValue)
<SE extends Throwable,CE extends Throwable,CLE extends Throwable,V>
VgetWithTtlCheckAndUpdate(SupplierWithException<TtlValue<V>,SE> getter, ThrowingConsumer<TtlValue<V>,CE> updater, ThrowingRunnable<CLE> stateClear)
<SE extends Throwable,CE extends Throwable,CLE extends Throwable,V>
TtlValue<V>getWrappedWithTtlCheckAndUpdate(SupplierWithException<TtlValue<V>,SE> getter, ThrowingConsumer<TtlValue<V>,CE> updater, ThrowingRunnable<CLE> stateClear)
<V> TtlValue<V>
rewrapWithNewTs(TtlValue<V> ttlValue)
<V> TtlValue<V>
wrapWithTs(V value)
-
-
-
Field Detail
-
original
protected final T original
Wrapped original state handler.
-
config
protected final StateTtlConfig config
-
timeProvider
protected final TtlTimeProvider timeProvider
-
updateTsOnRead
protected final boolean updateTsOnRead
Whether to renew expiration timestamp on state read access.
-
returnExpired
protected final boolean returnExpired
Whether to renew expiration timestamp on state read access.
-
ttl
protected final long ttl
State value time to live in milliseconds.
-
-
Constructor Detail
-
AbstractTtlDecorator
protected AbstractTtlDecorator(T original, StateTtlConfig config, TtlTimeProvider timeProvider)
-
-
Method Detail
-
getUnexpired
public <V> V getUnexpired(TtlValue<V> ttlValue)
-
expired
public <V> boolean expired(TtlValue<V> ttlValue)
-
wrapWithTs
public <V> TtlValue<V> wrapWithTs(V value)
-
getWithTtlCheckAndUpdate
public <SE extends Throwable,CE extends Throwable,CLE extends Throwable,V> V getWithTtlCheckAndUpdate(SupplierWithException<TtlValue<V>,SE> getter, ThrowingConsumer<TtlValue<V>,CE> updater, ThrowingRunnable<CLE> stateClear) throws SE extends Throwable, CE extends Throwable, CLE extends Throwable
- Throws:
SE extends Throwable
-
getWrappedWithTtlCheckAndUpdate
public <SE extends Throwable,CE extends Throwable,CLE extends Throwable,V> TtlValue<V> getWrappedWithTtlCheckAndUpdate(SupplierWithException<TtlValue<V>,SE> getter, ThrowingConsumer<TtlValue<V>,CE> updater, ThrowingRunnable<CLE> stateClear) throws SE extends Throwable, CE extends Throwable, CLE extends Throwable
- Throws:
SE extends Throwable
-
getElementWithTtlCheck
protected <T> T getElementWithTtlCheck(TtlValue<T> ttlValue)
-
-