- Type Parameters:
K- key type
V- value type
VR- transformed value type
public interface ValueTransformerWithKey<K,V,VR>The
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
Transformercan be used.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
close()Close this processor and clean up any resources.
init(ProcessorContext context)Initialize this transformer.
transform(K readOnlyKey, V value)Transform the given [key and ]value to a new value.
void init(ProcessorContext context)Initialize this transformer. This is called once per instance when the topology gets initialized.
transformTransform the given [key and ]value to a new value. Additionally, any
attachedto this operator can be accessed and modified arbitrarily (cf.
readOnlyKey- the read-only key
value- the value to be transformed
- the new value