V- value type
VR- transformed value type
public interface ValueTransformer<V,VR>
ValueTransformerinterface 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
ValueMapperfor stateless value transformation). Additionally, this
schedulea method to be
called periodicallywith the provided context. If
ValueTransformeris applied to a
KeyValuepair record the record's key is preserved.
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.
void init(ProcessorContext context)
close()will be called on it; the framework may later re-use the transformer by calling
context- the context
java.lang.IllegalStateException- If store gets registered after initialization is already finished
StreamsException- if the store's change log does not contain the partition
attachedto this operator can be accessed and modified arbitrarily (cf.
value- the value to be transformed
init(ProcessorContext)on it again.