public class RecordTranslatorSchemeAdapter extends Object implements RecordTranslator<ByteBuffer,ByteBuffer>
RecordTranslator that delegates to a Scheme.
DEFAULT_STREAM
Constructor and Description |
---|
RecordTranslatorSchemeAdapter(Scheme delegate) |
Modifier and Type | Method and Description |
---|---|
List<Object> |
apply(org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer> record)
Translate the ConsumerRecord into a list of objects that can be emitted.
|
Fields |
getFieldsFor(String stream)
Get the fields associated with a stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
streams
public RecordTranslatorSchemeAdapter(Scheme delegate)
public List<Object> apply(org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer> record)
RecordTranslator
Translate the ConsumerRecord into a list of objects that can be emitted.
apply
in interface Func<org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer>,List<Object>>
apply
in interface RecordTranslator<ByteBuffer,ByteBuffer>
record
- the record to translateKafkaTuple
if you want to route the tuple to a non-default stream. Return null
to discard an invalid ConsumerRecord
if KafkaSpoutConfig.Builder.setEmitNullTuples(boolean)
is set to false
.public Fields getFieldsFor(String stream)
RecordTranslator
Get the fields associated with a stream. The streams passed in are returned by the RecordTranslator.streams()
method.
getFieldsFor
in interface RecordTranslator<ByteBuffer,ByteBuffer>
stream
- the stream the fields are forCopyright © 2022 The Apache Software Foundation. All rights reserved.