ProcessorContext Contract

ProcessorContext is the contract of processor contexts that allow to access to contextual information when a processor is executed.

ProcessorContext is used when:

Tip
Use AbstractProcessor to manage the ProcessorContext of a custom Processor.
Table 1. ProcessorContext Contract
Method Description

appConfigs

Map<String, Object> appConfigs()

appConfigsWithPrefix

Map<String, Object> appConfigsWithPrefix(String prefix)

applicationId

String applicationId()

commit

void commit()

forward

void forward(K key, V value)
void forward(K key, V value, To to)

Forwards a record downstream (to child processors if there are any or To processor)

getStateStore

StateStore getStateStore(String name)

Retrieves the state store by name

Used when…​FIXME

headers

Headers headers()

keySerde

Serde<?> keySerde()

metrics

StreamsMetrics metrics()

offset

long offset()

partition

int partition()

register

schedule

Cancellable schedule(
  Duration interval,
  PunctuationType type,
  Punctuator callback)

Schedules a Punctuator (a periodic action) to be executed at stream (STREAM_TIME) or system (WALL_CLOCK_TIME) time and that can be cancelled

  • STREAM_TIME advances by the processing of messages in accordance with the timestamp as extracted by the TimestampExtractor

  • WALL_CLOCK_TIME uses the system time which advances at the polling interval

stateDir

File stateDir()

taskId

TaskId taskId()

timestamp

long timestamp()

topic

String topic()

valueSerde

Serde<?> valueSerde()
Table 2. ProcessorContexts (Direct Implementations and Extensions)
ProcessorContext Description

ForwardingDisabledProcessorContext

InternalProcessorContext

Extension of ProcessorContext

results matching ""

    No results matching ""