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.kafka.common.TopicPartition,Long> offsetsToCommit)
Commits the given offset for the partitions.
|
static long |
getOffsetFromZooKeeper(org.I0Itec.zkclient.ZkClient zkClient,
String groupId,
String topic,
int partition) |
void |
seekFetcherToInitialOffsets(List<org.apache.kafka.common.TopicPartition> partitions,
Fetcher fetcher)
Positions the given fetcher to the initial read offsets where the stream consumption
will start from.
|
static void |
setOffsetInZooKeeper(org.I0Itec.zkclient.ZkClient zkClient,
String groupId,
String topic,
int partition,
long offset) |
public ZookeeperOffsetHandler(Properties props)
public void commit(Map<org.apache.kafka.common.TopicPartition,Long> offsetsToCommit)
OffsetHandlercommit in interface OffsetHandleroffsetsToCommit - The offset to commit, per partition.public void seekFetcherToInitialOffsets(List<org.apache.kafka.common.TopicPartition> partitions, Fetcher fetcher)
OffsetHandlerseekFetcherToInitialOffsets in interface OffsetHandlerpartitions - The partitions for which to seeks the fetcher to the beginning.fetcher - The fetcher that will pull data from Kafka and must be positioned.public void close()
throws IOException
OffsetHandlerclose in interface OffsetHandlerIOException - Thrown, if the closing fails.public static void setOffsetInZooKeeper(org.I0Itec.zkclient.ZkClient zkClient,
String groupId,
String topic,
int partition,
long offset)
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.