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 Details

    • 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 Details

    • AbstractTtlDecorator

      protected AbstractTtlDecorator(T original, org.apache.flink.api.common.state.StateTtlConfig config, TtlTimeProvider timeProvider)
  • Method Details

    • getUnexpired

      public <V> V getUnexpired(TtlValue<V> ttlValue)
    • expired

      public <V> boolean expired(TtlValue<V> ttlValue)
    • wrapWithTs

      public <V> TtlValue<V> wrapWithTs(V value)
    • rewrapWithNewTs

      public <V> TtlValue<V> rewrapWithNewTs(TtlValue<V> ttlValue)
    • 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, CE, CLE
      Throws:
      SE extends Throwable
      CE extends Throwable
      CLE 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, CE, CLE
      Throws:
      SE extends Throwable
      CE extends Throwable
      CLE extends Throwable
    • getElementWithTtlCheck

      protected <T> T getElementWithTtlCheck(TtlValue<T> ttlValue)