Package org.apache.storm.kafka.spout
Class DefaultRecordTranslator<K,V>
java.lang.Object
org.apache.storm.kafka.spout.DefaultRecordTranslator<K,V>
- All Implemented Interfaces:
Serializable,Func<org.apache.kafka.clients.consumer.ConsumerRecord<K,,V>, List<Object>> RecordTranslator<K,V>
- See Also:
-
Field Summary
FieldsFields inherited from interface org.apache.storm.kafka.spout.RecordTranslator
DEFAULT_STREAM -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.storm.kafka.spout.RecordTranslator
streams
-
Field Details
-
FIELDS
-
-
Constructor Details
-
DefaultRecordTranslator
public DefaultRecordTranslator()
-
-
Method Details
-
apply
Description copied from interface:RecordTranslatorTranslate the ConsumerRecord into a list of objects that can be emitted.- Specified by:
applyin interfaceFunc<K,V> - Specified by:
applyin interfaceRecordTranslator<K,V> - Parameters:
record- the record to translate- Returns:
- the objects in the tuple. Return a
KafkaTupleif you want to route the tuple to a non-default stream. Returnnullto discard an invalidConsumerRecordifKafkaSpoutConfig.Builder.setEmitNullTuples(boolean)is set tofalse.
-
getFieldsFor
Description copied from interface:RecordTranslatorGet the fields associated with a stream. The streams passed in are returned by theRecordTranslator.streams()method.- Specified by:
getFieldsForin interfaceRecordTranslator<K,V> - Parameters:
stream- the stream the fields are for- Returns:
- the fields for that stream.
-