public class KafkaUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
KafkaUtils.KafkaOffsetMetric |
Constructor and Description |
---|
KafkaUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Partition> |
calculatePartitionsForTask(List<GlobalPartitionInformation> partitons,
int totalTasks,
int taskIndex,
int taskId) |
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,
String topic) |
static Iterable<List<Object>> |
generateTuples(MessageMetadataSchemeAsMultiScheme scheme,
kafka.message.Message msg,
Partition partition,
long offset) |
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 |
taskPrefix(int taskIndex,
int totalTasks,
int taskId) |
public static IBrokerReader makeBrokerReader(Map stormConf, KafkaConfig conf)
public static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, KafkaConfig config)
public static long getOffset(kafka.javaapi.consumer.SimpleConsumer consumer, String topic, int partition, long startOffsetTime)
public static kafka.javaapi.message.ByteBufferMessageSet fetchMessages(KafkaConfig config, kafka.javaapi.consumer.SimpleConsumer consumer, Partition partition, long offset) throws TopicOffsetOutOfRangeException, FailedFetchException, RuntimeException
public static Iterable<List<Object>> generateTuples(KafkaConfig kafkaConfig, kafka.message.Message msg, String topic)
public static Iterable<List<Object>> generateTuples(MessageMetadataSchemeAsMultiScheme scheme, kafka.message.Message msg, Partition partition, long offset)
public static List<Partition> calculatePartitionsForTask(List<GlobalPartitionInformation> partitons, int totalTasks, int taskIndex, int taskId)
public static String taskPrefix(int taskIndex, int totalTasks, int taskId)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.