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 org.apache.flink.api.common.state.StateTtlConfigconfigprotected ToriginalWrapped original state handler.protected booleanreturnExpiredWhether to renew expiration timestamp on state read access.protected TtlTimeProvidertimeProviderprotected longttlState value time to live in milliseconds.protected booleanupdateTsOnReadWhether to renew expiration timestamp on state read access.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTtlDecorator(T original, org.apache.flink.api.common.state.StateTtlConfig config, TtlTimeProvider timeProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> booleanexpired(TtlValue<V> ttlValue)protected <T> TgetElementWithTtlCheck(TtlValue<T> ttlValue)<V> VgetUnexpired(TtlValue<V> ttlValue)<SE extends Throwable,CE extends Throwable,CLE extends Throwable,V>
VgetWithTtlCheckAndUpdate(org.apache.flink.util.function.SupplierWithException<TtlValue<V>,SE> getter, org.apache.flink.util.function.ThrowingConsumer<TtlValue<V>,CE> updater, org.apache.flink.util.function.ThrowingRunnable<CLE> stateClear)<SE extends Throwable,CE extends Throwable,CLE extends Throwable,V>
TtlValue<V>getWrappedWithTtlCheckAndUpdate(org.apache.flink.util.function.SupplierWithException<TtlValue<V>,SE> getter, org.apache.flink.util.function.ThrowingConsumer<TtlValue<V>,CE> updater, org.apache.flink.util.function.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 org.apache.flink.api.common.state.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, org.apache.flink.api.common.state.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(org.apache.flink.util.function.SupplierWithException<TtlValue<V>,SE> getter, org.apache.flink.util.function.ThrowingConsumer<TtlValue<V>,CE> updater, org.apache.flink.util.function.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(org.apache.flink.util.function.SupplierWithException<TtlValue<V>,SE> getter, org.apache.flink.util.function.ThrowingConsumer<TtlValue<V>,CE> updater, org.apache.flink.util.function.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)
-
-