K- key type
V- value type
VR- transformed value type
public interface ValueTransformerWithKey<K,V,VR>
ValueTransformerWithKeyinterface 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
ValueMapperfor stateless value transformation). Additionally, this
schedulea method to be
called periodicallywith the provided context. Note that the key is read-only and should not be modified, as this can lead to corrupt partitioning. If
ValueTransformerWithKeyis applied to a
KeyValuepair record the record's key is preserved.
If a record's key and value should be modified
Transformer can be used.
|Modifier and Type||Method and Description|
Close this processor and clean up any resources.
Initialize this transformer.
Transform the given [key and ]value to a new value.
void init(ProcessorContext context)
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.
readOnlyKey- the read-only key
value- the value to be transformed