Search in sources :

Example 1 with KafkaTuple

use of org.apache.storm.kafka.spout.KafkaTuple in project streamline by hortonworks.

the class AvroKafkaSpoutTranslator method apply.

@Override
public List<Object> apply(ConsumerRecord<Object, ByteBuffer> consumerRecord) {
    Map<String, Object> keyValues = (Map<String, Object>) deserializer().deserialize(new ByteBufferInputStream(consumerRecord.value()), readerSchemaVersion);
    StreamlineEvent streamlineEvent = StreamlineEventImpl.builder().putAll(keyValues).dataSourceId(dataSourceId).build();
    KafkaTuple kafkaTuple = new KafkaTuple(streamlineEvent);
    kafkaTuple.routedTo(outputStream);
    return kafkaTuple;
}
Also used : KafkaTuple(org.apache.storm.kafka.spout.KafkaTuple) StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

StreamlineEvent (com.hortonworks.streamline.streams.StreamlineEvent)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 KafkaTuple (org.apache.storm.kafka.spout.KafkaTuple)1