Interface ValueTransformerWithKey<K,V,VR>

Type Parameters:
K - key type
V - value type
VR - transformed value type

public interface ValueTransformerWithKey<K,V,VR>
The ValueTransformerWithKey interface for stateful mapping of a value to a new value (with possible new type). This is a stateful record-by-record operation, i.e, transform(Object, Object) is invoked individually for each record of a stream and can access and modify a state that is available beyond a single call of transform(Object, Object) (cf. ValueMapper for stateless value transformation). Additionally, this ValueTransformerWithKey can schedule a method to be called periodically with the provided context. Note that the key is read-only and should not be modified, as this can lead to corrupt partitioning. If ValueTransformerWithKey is applied to a KeyValue pair record the record's key is preserved.

Use ValueTransformerWithKeySupplier to provide new instances of ValueTransformerWithKey to Kafka Stream's runtime.

If a record's key and value should be modified Transformer can be used.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close this processor and clean up any resources.
    void
    Initialize this transformer.
    transform(K readOnlyKey, V value)
    Transform the given [key and] value to a new value.