public class ZookeeperOffsetHandler extends Object implements OffsetHandler
| Constructor and Description |
|---|
ZookeeperOffsetHandler(Properties props) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the offset handler, releasing all resources.
|
void |
commit(Map<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition,Long> offsetsToCommit)
Commits the given offset for the partitions.
|
static long |
getOffsetFromZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition) |
Map<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition,Long> |
getOffsets(List<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition> partitions)
Positions the given fetcher to the initial read offsets where the stream consumption
will start from.
|
static void |
setOffsetInZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition,
long offset) |
public ZookeeperOffsetHandler(Properties props)
public void commit(Map<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition,Long> offsetsToCommit) throws Exception
OffsetHandlercommit in interface OffsetHandleroffsetsToCommit - The offset to commit, per partition.Exceptionpublic Map<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition,Long> getOffsets(List<org.apache.flink.streaming.connectors.kafka.internals.KafkaTopicPartition> partitions) throws Exception
OffsetHandlergetOffsets in interface OffsetHandlerpartitions - The partitions for which to seeks the fetcher to the beginning.Exceptionpublic void close()
throws IOException
OffsetHandlerclose in interface OffsetHandlerIOException - Thrown, if the closing fails.public static void setOffsetInZooKeeper(org.apache.curator.framework.CuratorFramework curatorClient,
String groupId,
String topic,
int partition,
long offset)
throws Exception
ExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.