public class KafkaTridentSpoutBatchMetadata extends Object implements Serializable
Wraps transaction batch information
Modifier and Type | Field and Description |
---|---|
static String |
FIRST_OFFSET_KEY |
static String |
LAST_OFFSET_KEY |
static String |
TOPIC_PARTITION_KEY |
Constructor and Description |
---|
KafkaTridentSpoutBatchMetadata(org.apache.kafka.common.TopicPartition topicPartition,
org.apache.kafka.clients.consumer.ConsumerRecords<K,V> consumerRecords)
Builds a metadata object from a non-empty set of records.
|
KafkaTridentSpoutBatchMetadata(org.apache.kafka.common.TopicPartition topicPartition,
long firstOffset,
long lastOffset)
Builds a metadata object.
|
Modifier and Type | Method and Description |
---|---|
static KafkaTridentSpoutBatchMetadata |
fromMap(Map<String,Object> map)
Constructs a metadata object from a Map in the format produced by
toMap() . |
long |
getFirstOffset() |
long |
getLastOffset() |
org.apache.kafka.common.TopicPartition |
getTopicPartition() |
Map<String,Object> |
toMap()
Writes this metadata object to a Map so Trident can read/write it to Zookeeper.
|
String |
toString() |
public static final String TOPIC_PARTITION_KEY
public static final String FIRST_OFFSET_KEY
public static final String LAST_OFFSET_KEY
public KafkaTridentSpoutBatchMetadata(org.apache.kafka.common.TopicPartition topicPartition, long firstOffset, long lastOffset)
Builds a metadata object.
topicPartition
- The topic partitionfirstOffset
- The first offset for the batchlastOffset
- The last offset for the batchpublic KafkaTridentSpoutBatchMetadata(org.apache.kafka.common.TopicPartition topicPartition, org.apache.kafka.clients.consumer.ConsumerRecords<K,V> consumerRecords)
Builds a metadata object from a non-empty set of records.
topicPartition
- The topic partition the records belong to.consumerRecords
- The non-empty set of records.public long getFirstOffset()
public long getLastOffset()
public org.apache.kafka.common.TopicPartition getTopicPartition()
public static KafkaTridentSpoutBatchMetadata fromMap(Map<String,Object> map)
Constructs a metadata object from a Map in the format produced by toMap()
.
map
- The source mappublic Map<String,Object> toMap()
Writes this metadata object to a Map so Trident can read/write it to Zookeeper.
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.