Skip to content

StateManager

StateManager is an abstraction of state managers that act as middlemen between state stores and FlatMapGroupsWithStateExec physical operator used in Arbitrary Stateful Streaming Aggregation.

Contract

getAllState

getAllState(
  store: StateStore): Iterator[StateData]

Retrieves all state data (for all keys) from the given StateStore

Used when:

getState

getState(
  store: StateStore,
  keyRow: UnsafeRow): StateData

Gets the state data for the given key from the given StateStore

Used when:

putState

putState(
  store: StateStore,
  keyRow: UnsafeRow,
  state: Any,
  timeoutTimestamp: Long): Unit

Persists (puts) the given state (value) for the given key in the given StateStore

Used when:

removeState

removeState(
  store: StateStore,
  keyRow: UnsafeRow): Unit

Removes the state for the given key from the given StateStore

Used when:

stateSchema

stateSchema: StructType

Used when:

Implementations