Versions Compared

Key

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

...

This change also positions us to make other public API improvements, like KAFKA-8396, to collapse transformer types that become redundant after this KIP.

Public Interfaces

(deprecation) org.apache.kafka.streams.processor.{Processor, ProcessorSupplier, ProcessorContext}

  • these classes are deprecated, which would be propagated to any public APIs that reference them.

...

Code Block
public interface ProcessorSupplier<KIn, VIn, KOut, VOut> {
  Processor<KIn, VIn, KOut, VOut> get();
}

(

...

new class) org.apache.kafka.streams.processor.api.ProcessorContext

  • Added Copy of processor.ProcessorContext with added generic parameters <K, V>
    • Adjusted bounds on forward methods (only showing first diff for brevity
      • code snippet below shows how the generic parameters compare to processor.ProcessorContext
    • Drop the deprecated members of processor.ProcessorContextThese changes are fully backward compatible, since the type bounds have not changed for a raw-type usage of ProcessorContext. Existing implementations will start to get a warning, since they are now using a "raw type" of a generically typed class.
    Code Block
    public interface ProcessorContext<K, V> {
      ...
    - <K,            V>            void forward(final K  key, final V  value);
    + <K1 extends K, V1 extends V> void forward(final K1 key, final V1 value);
    . <K1 extends K, V1 extends V> void forward(final K1 key, final V1 value, final To to);
    
    // the following are deprecated. We'll update the generic bounds, and keep them deprecated
    . @Deprecated
    . <K1 extends K, V1 extends V> void forward(final K1 key, final V1 value, final int childIndex);
    . @Deprecated
    . <K1 extends K, V1 extends V> void forward(final K1 key, final V1 value, final String childName);
    }


    (new method) org.apache.kafka.streams.StreamsBuilder

    ...