storm.kafka
Class KafkaUtils

java.lang.Object
  extended by storm.kafka.KafkaUtils

public class KafkaUtils
extends Object


Nested Class Summary
static class KafkaUtils.KafkaOffsetMetric
           
 
Field Summary
static org.slf4j.Logger LOG
           
 
Constructor Summary
KafkaUtils()
           
 
Method Summary
static List<Partition> calculatePartitionsForTask(GlobalPartitionInformation partitionInformation, int totalTasks, int taskIndex)
           
static kafka.javaapi.message.ByteBufferMessageSet fetchMessages(KafkaConfig config, kafka.javaapi.consumer.SimpleConsumer consumer, Partition partition, long offset)
           
static Iterable<List<Object>> generateTuples(KafkaConfig kafkaConfig, kafka.message.Message msg)
           
static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, KafkaConfig config)
           
static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, long startOffsetTime)
           
static IBrokerReader makeBrokerReader(Map stormConf, KafkaConfig conf)
           
static String taskId(int taskIndex, int totalTasks)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.slf4j.Logger LOG
Constructor Detail

KafkaUtils

public KafkaUtils()
Method Detail

makeBrokerReader

public static IBrokerReader makeBrokerReader(Map stormConf,
                                             KafkaConfig conf)

getOffset

public static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer,
                             String topic,
                             int partition,
                             KafkaConfig config)

getOffset

public static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer,
                             String topic,
                             int partition,
                             long startOffsetTime)

fetchMessages

public static kafka.javaapi.message.ByteBufferMessageSet fetchMessages(KafkaConfig config,
                                                                       kafka.javaapi.consumer.SimpleConsumer consumer,
                                                                       Partition partition,
                                                                       long offset)
                                                                throws UpdateOffsetException
Throws:
UpdateOffsetException

generateTuples

public static Iterable<List<Object>> generateTuples(KafkaConfig kafkaConfig,
                                                    kafka.message.Message msg)

calculatePartitionsForTask

public static List<Partition> calculatePartitionsForTask(GlobalPartitionInformation partitionInformation,
                                                         int totalTasks,
                                                         int taskIndex)

taskId

public static String taskId(int taskIndex,
                            int totalTasks)


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.