Constructor and Description |
---|
ZookeeperOffsetHandler(Properties props) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the offset handler.
|
Long |
getCommittedOffset(KafkaTopicPartition partition) |
static Long |
getOffsetFromZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition) |
void |
prepareAndCommitOffsets(Map<KafkaTopicPartition,Long> internalOffsets)
Commits offsets for Kafka partitions to ZooKeeper.
|
static void |
setOffsetInZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition,
long offset) |
public ZookeeperOffsetHandler(Properties props)
public void prepareAndCommitOffsets(Map<KafkaTopicPartition,Long> internalOffsets) throws Exception
internalOffsets
- The internal offsets (representing last processed records) for the partitions to commit.Exception
- The method forwards exceptions.public Long getCommittedOffset(KafkaTopicPartition partition) throws Exception
partition
- The partition to read offset for.Exception
- This method forwards exceptions.public void close() throws IOException
IOException
- Thrown, if the handler cannot be closed properly.public static void setOffsetInZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient, String groupId, String topic, int partition, long offset) throws Exception
Exception
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.