THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Record metadata is accessible via ProcessorContext
that is provided via Processor#init()
, Transformer#init()
, and ValueTransformer#init()
. The context object is updated under the hood and contains the metadata for the currently processed record each time process()
is transform()
, or transformValue()
is called.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public class MyProcessor implements Processor<KEY_TYPE, VALUE_TYPE> { private ProcessorContext context; @Override public void init(final ProcessorContext context) { this.context = context; } @Override void process(final KEY_TYPE key, final VALUE_TYPE value) { this.context.offset(); // returns the current record's offset // you can also access #partition(), #timestamp(), and #topic() } // other methods omitted for brevity } |
...