Packages

c

org.apache.spark.sql.execution.streaming

ValueStateImplWithTTL

class ValueStateImplWithTTL[S] extends SingleKeyTTLStateImpl with ValueState[S]

Class that provides a concrete implementation for a single value state associated with state variables (with ttl expiration support) used in the streaming transformWithState operator.

S

- data type of object that will be stored

Linear Supertypes
ValueState[S], Serializable, SingleKeyTTLStateImpl, TTLState, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValueStateImplWithTTL
  2. ValueState
  3. Serializable
  4. SingleKeyTTLStateImpl
  5. TTLState
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ValueStateImplWithTTL(store: StateStore, stateName: String, keyExprEnc: ExpressionEncoder[Any], valEncoder: Encoder[S], ttlConfig: TTLConfig, batchTimestampMs: Long)

    store

    - reference to the StateStore instance to be used for storing state

    stateName

    - name of logical state partition

    keyExprEnc

    - Spark SQL encoder for key

    valEncoder

    - Spark SQL encoder for value

    ttlConfig

    - TTL configuration for values stored in this state

    batchTimestampMs

    - current batch processing timestamp.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clear(): Unit

    Function to remove state for given key

    Function to remove state for given key

    Definition Classes
    ValueStateImplWithTTL → ValueState
  6. def clearExpiredState(): Long

    Clears any state which has ttl older than ttlExpirationMs.

    Clears any state which has ttl older than ttlExpirationMs.

    returns

    number of values cleaned up.

    Definition Classes
    SingleKeyTTLStateImplTTLState
  7. def clearIfExpired(groupingKey: Array[Byte]): Long

    Clears the user state associated with this grouping key if it has expired.

    Clears the user state associated with this grouping key if it has expired. This function is called by Spark to perform cleanup at the end of transformWithState processing.

    Spark uses a secondary index to determine if the user state for this grouping key has expired. However, its possible that the user has updated the TTL and secondary index is out of date. Implementations must validate that the user State has actually expired before cleanup based on their own State data.

    groupingKey

    grouping key for which cleanup should be performed.

    returns

    true if the state was cleared, false otherwise.

    Definition Classes
    ValueStateImplWithTTLSingleKeyTTLStateImpl
  8. def clearTTLState(): Unit

    This function will be called when clear() on State Variables with ttl enabled is called.

    This function will be called when clear() on State Variables with ttl enabled is called. This function should clear any associated ttlState, since we are clearing the user state.

    Definition Classes
    SingleKeyTTLStateImpl
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def exists(): Boolean

    Function to check if state exists.

    Function to check if state exists. Returns true if present and false otherwise

    Definition Classes
    ValueStateImplWithTTL → ValueState
  13. def get(): S

    Function to return associated value with key if exists and null otherwise

    Function to return associated value with key if exists and null otherwise

    Definition Classes
    ValueStateImplWithTTL → ValueState
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. def getOption(): Option[S]

    Function to return Option of value if exists and None otherwise

    Function to return Option of value if exists and None otherwise

    Definition Classes
    ValueStateImplWithTTL → ValueState
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. def update(newState: S): Unit

    Function to update and overwrite state associated with given key

    Function to update and overwrite state associated with given key

    Definition Classes
    ValueStateImplWithTTL → ValueState
  24. def upsertTTLForStateKey(expirationMs: Long, groupingKey: Array[Byte]): Unit
    Definition Classes
    SingleKeyTTLStateImpl
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from ValueState[S]

Inherited from Serializable

Inherited from SingleKeyTTLStateImpl

Inherited from TTLState

Inherited from AnyRef

Inherited from Any

Ungrouped