Package org.apache.storm.kafka.spout
Interface RecordTranslator<K,V> 
- All Superinterfaces:
- Func<org.apache.kafka.clients.consumer.ConsumerRecord<K,,- V>, - List<Object>> - Serializable
- All Known Implementing Classes:
- ByTopicRecordTranslator,- DefaultRecordTranslator,- OnlyValueRecordTranslator,- RecordTranslatorSchemeAdapter,- SimpleRecordTranslator
public interface RecordTranslator<K,V> 
extends Serializable, Func<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>,List<Object>>  
Translate a 
ConsumerRecord to a tuple.- 
Field SummaryFields
- 
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.
- 
Field Details- 
DEFAULT_STREAM
 
- 
- 
Method Details- 
applyTranslate the ConsumerRecord into a list of objects that can be emitted.- Specified by:
- applyin interface- Func<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.
 
- 
getFieldsForGet the fields associated with a stream. The streams passed in are returned by thestreams()method.- Parameters:
- stream- the stream the fields are for
- Returns:
- the fields for that stream.
 
- 
streamsGet the list of streams this translator will handle.- Returns:
- the list of streams that this will handle.
 
 
-