Interface ValueTransformer<V,​VR>

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

public interface ValueTransformer<V,​VR>
The ValueTransformer 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) 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) (cf. ValueMapper for stateless value transformation). Additionally, this ValueTransformer can schedule a method to be called periodically with the provided context. If ValueTransformer is applied to a KeyValue pair record the record's key is preserved.

Use ValueTransformerSupplier to provide new instances of ValueTransformer to Kafka Stream's runtime.

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

See Also:
ValueTransformerSupplier, ValueTransformerWithKeySupplier, KStream.transformValues(ValueTransformerSupplier, String...), KStream.transformValues(ValueTransformerWithKeySupplier, String...), Transformer
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close this transformer and clean up any resources.
    void init​(ProcessorContext context)
    Initialize this transformer.
    VR transform​(V value)
    Transform the given value to a new value.