Packages

class MapStateImplWithTTL[K, V] extends CompositeKeyTTLStateImpl with MapState[K, V] with Logging

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

K

- type of key for map state variable

V

- type of value for map state variable

returns

- instance of MapState of type [K,V] that can be used to store state persistently

Linear Supertypes
Logging, MapState[K, V], Serializable, CompositeKeyTTLStateImpl, TTLState, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MapStateImplWithTTL
  2. Logging
  3. MapState
  4. Serializable
  5. CompositeKeyTTLStateImpl
  6. TTLState
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MapStateImplWithTTL(store: StateStore, stateName: String, keyExprEnc: ExpressionEncoder[Any], userKeyEnc: Encoder[K], valEncoder: Encoder[V], ttlConfig: TTLConfig, batchTimestampMs: Long)

    store

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

    stateName

    - name of the state variable

    keyExprEnc

    - Spark SQL encoder for key

    userKeyEnc

    - Spark SQL encoder for the map key

    valEncoder

    - SQL encoder for state variable

    ttlConfig

    - the ttl configuration (time to live duration etc.)

    batchTimestampMs

    - current batch processing timestamp.

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

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

    Remove this state.

    Remove this state.

    Definition Classes
    MapStateImplWithTTL → MapState
  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
    CompositeKeyTTLStateImplTTLState
  7. def clearIfExpired(groupingKey: Array[Byte], userKey: 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.

    userKey

    user key for which cleanup should be performed.

    Definition Classes
    MapStateImplWithTTLCompositeKeyTTLStateImpl
  8. def clearTTLState(): Unit
    Definition Classes
    CompositeKeyTTLStateImpl
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  10. def containsKey(key: K): Boolean

    Check if the user key is contained in the map

    Check if the user key is contained in the map

    Definition Classes
    MapStateImplWithTTL → MapState
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def exists(): Boolean

    Whether state exists or not.

    Whether state exists or not.

    Definition Classes
    MapStateImplWithTTL → MapState
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. def getValue(key: K): V

    Get the state value if it exists

    Get the state value if it exists

    Definition Classes
    MapStateImplWithTTL → MapState
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  18. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  21. def iterator(): Iterator[(K, V)]

    Get the map associated with grouping key

    Get the map associated with grouping key

    Definition Classes
    MapStateImplWithTTL → MapState
  22. def keys(): Iterator[K]

    Get the list of keys present in map associated with grouping key

    Get the list of keys present in map associated with grouping key

    Definition Classes
    MapStateImplWithTTL → MapState
  23. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  24. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  32. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  33. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  34. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  37. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  39. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  40. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  42. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  43. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  44. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  47. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  48. def removeKey(key: K): Unit

    Remove user key from map state

    Remove user key from map state

    Definition Classes
    MapStateImplWithTTL → MapState
  49. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  50. def toString(): String
    Definition Classes
    AnyRef → Any
  51. def updateValue(key: K, value: V): Unit

    Update value for given user key

    Update value for given user key

    Definition Classes
    MapStateImplWithTTL → MapState
  52. def upsertTTLForStateKey(expirationMs: Long, groupingKey: Array[Byte], userKey: Array[Byte]): Unit
    Definition Classes
    CompositeKeyTTLStateImpl
  53. def values(): Iterator[V]

    Get the list of values present in map associated with grouping key

    Get the list of values present in map associated with grouping key

    Definition Classes
    MapStateImplWithTTL → MapState
  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  56. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  57. def withLogContext(context: HashMap[String, String])(body: => Unit): Unit
    Attributes
    protected
    Definition Classes
    Logging

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 Logging

Inherited from MapState[K, V]

Inherited from Serializable

Inherited from TTLState

Inherited from AnyRef

Inherited from Any

Ungrouped