@Internal public class ZookeeperOffsetHandler extends Object
| Constructor and Description |
|---|
ZookeeperOffsetHandler(Properties props) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the offset handler.
|
Long |
getCommittedOffset(org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition partition) |
static Long |
getOffsetFromZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition) |
void |
prepareAndCommitOffsets(Map<org.apache.flink.streaming.connectors.kafka.internals.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<org.apache.flink.streaming.connectors.kafka.internals.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(org.apache.flink.streaming.connectors.kafka.internals.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
ExceptionCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.