Package org.apache.storm.kafka.spout
Class SimpleRecordTranslator<K,V> 
java.lang.Object
org.apache.storm.kafka.spout.SimpleRecordTranslator<K,V> 
- All Implemented Interfaces:
- Serializable,- Func<org.apache.kafka.clients.consumer.ConsumerRecord<K,,- V>, - List<Object>> - RecordTranslator<K,- V> 
- See Also:
- 
Field SummaryFields inherited from interface org.apache.storm.kafka.spout.RecordTranslatorDEFAULT_STREAM
- 
Constructor SummaryConstructorsConstructorDescriptionSimpleRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields) SimpleRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields, String stream) Creates a SimpleRecordTranslator.
- 
Method SummaryModifier and TypeMethodDescriptionTranslate the ConsumerRecord into a list of objects that can be emitted.getFieldsFor(String stream) Get the fields associated with a stream.streams()Get the list of streams this translator will handle.
- 
Constructor Details- 
SimpleRecordTranslator
- 
SimpleRecordTranslatorpublic SimpleRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields, String stream) Creates a SimpleRecordTranslator.- Parameters:
- func- The mapping function responsible for translating a Kafka record to a Tuple
- fields- The fields tuples constructed by this translator will contain
- stream- The stream tuples constructed by this translator will target
 
 
- 
- 
Method Details- 
applyDescription copied from interface:RecordTranslatorTranslate the ConsumerRecord into a list of objects that can be emitted.- Specified by:
- applyin interface- Func<K,- V> 
- Specified by:
- applyin interface- RecordTranslator<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.
 
- 
getFieldsForDescription copied from interface:RecordTranslatorGet the fields associated with a stream. The streams passed in are returned by theRecordTranslator.streams()method.- Specified by:
- getFieldsForin interface- RecordTranslator<K,- V> 
- Parameters:
- stream- the stream the fields are for
- Returns:
- the fields for that stream.
 
- 
streamsDescription copied from interface:RecordTranslatorGet the list of streams this translator will handle.- Specified by:
- streamsin interface- RecordTranslator<K,- V> 
- Returns:
- the list of streams that this will handle.
 
 
-