// FIXME: Demo
Transformer — Record-by-Record Stateful Transformation
Transformer
is the contract that allows for a stateful transformation of every record in the input stream into zero or more output records (both key and value type can be altered arbitrarily).
In order to emit (produce) no record, transform should simply return null
.
In order to use a state, a state store has to be registered beforehand (using addStateStore
or addGlobalStore
) before they can be connected to the Transformer
.
You can access a state store using the ProcessorContext that is given when a transformer is initialized.
Tip
|
You could emit more output records for a single record using the ProcessorContext and its forward method.
|
Transformer
is created (supplied) using a corresponding TransformerSupplier.
Property | Description |
---|---|
|
Closes the transformer Used exclusively when |
|
Initializes the transformer in the given ProcessorContext Used exclusively when |
|
Transforms a single record (into a In order to emit (produce) no record, Used exclusively when |
Transformer
is used to create a KStreamTransformProcessor.