StateManager Contract — State Store Managers

StateManager is the contract of state store managers that manage state stores and are checkpointable.

Table 1. StateManager Contract
Method Description

baseDir

File baseDir()

Base directory

Used exclusively when AbstractProcessorContext is requested for the state directory

close

void close(
  Map<TopicPartition, Long> offsets)

Closes a state manager

Used when:

flush

void flush()

Flushes all state stores registered (in the state manager)

Used when:

getGlobalStore

StateStore getGlobalStore(
  String name)

Accessing the global state store by name

Used when:

getStore

StateStore getStore(
  String name)

Accessing the state store by name

Used when AbstractTask and ProcessorContextImpl are requested to get the state store by name

register

void register(
  StateStore store,
  StateRestoreCallback stateRestoreCallback)

Registers a state store (with an associated StateRestoreCallback)

Used exclusively when AbstractProcessorContext is requested to register a state store

reinitializeStateStoresForPartitions

void reinitializeStateStoresForPartitions(
  Collection<TopicPartition> partitions,
  InternalProcessorContext processorContext)

Used when:

Table 2. StateManagers (Direct Extensions)
StateManager Description

AbstractStateManager

GlobalStateManager

results matching ""

    No results matching ""