Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public interface StateStoreContext {
    ...

    /**
     * Return the metadata of the current recordtopic/partition/offset if available. Processors may be invoked to
     * processThis ametadata source record from an input topic, to run in a scheduledStateStore punctuation
is     * (see {@link org.apache.kafka.streams.processor.api.ProcessorContext#schedule(Duration, PunctuationType, Punctuator)}),
     * or because a parent processor called {@link org.apache.kafka.streams.processor.api.ProcessorContext#forward(Record)}.
     * <p>
     * In the case of a punctuation, there is no source record, so this metadata would bedefined as the metadata of the record
     * undefined. Note that when a punctuator invokes {@link ProcessorContext#forward(Record)},
     * downstream processors will receive the forwarded record as a regular
     * {@link Processor#process(Record)} invocation. In other words, it wouldn't be apparent to
     * downstream processors whether or not the record is currently being processed cameby fromthe anStreamTask input topic
     * or punctuation and therefore whether or not this metadata is defined. This is why
     * the return type of this method is {@link Optional}that holds the store.
     * <p>
     * If there is any possibility of punctuators upstream, any access
     * to this field should consider the case of
     * "<code>recordMetadata().isPresent() == false</code>".Note that the metadata is not defined during all store interactions, for
     * Of courseexample, itwhile wouldthe beStreamTask safestis torunning always guard this conditiona punctuation.
     */
      Optional<RecordMetadata> Optional<RecordMetadata> recordMetadata();

    ...
}


Compatibility, Deprecation, and Migration Plan

...