public static interface ConsumerSeekAware.ConsumerSeekCallback
Modifier and Type | Method and Description |
---|---|
void |
seek(java.lang.String topic,
int partition,
long offset)
Queue a seek operation to the consumer.
|
void |
seekRelative(java.lang.String topic,
int partition,
long offset,
boolean toCurrent)
Queue a seek to a position relative to the start or end of the current position.
|
default void |
seekToBeginning(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
Queue a seekToBeginning operation to the consumer for each
TopicPartition . |
void |
seekToBeginning(java.lang.String topic,
int partition)
Queue a seekToBeginning operation to the consumer.
|
default void |
seekToEnd(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
Queue a seekToEnd operation to the consumer for each
TopicPartition . |
void |
seekToEnd(java.lang.String topic,
int partition)
Queue a seekToEnd operation to the consumer.
|
void |
seekToTimestamp(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions,
long timestamp)
Seek to the first offset greater than or equal to the time stamp.
|
void |
seekToTimestamp(java.lang.String topic,
int partition,
long timestamp)
Seek to the first offset greater than or equal to the time stamp.
|
void seek(java.lang.String topic, int partition, long offset)
topic
- the topic.partition
- the partition.offset
- the offset (absolute).void seekToBeginning(java.lang.String topic, int partition)
topic
- the topic.partition
- the partition.default void seekToBeginning(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
TopicPartition
. The seek will occur after any pending offset commits.
The consumer must be currently assigned the specified partition(s).partitions
- the TopicPartition
s.void seekToEnd(java.lang.String topic, int partition)
topic
- the topic.partition
- the partition.default void seekToEnd(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
TopicPartition
.
The seek will occur after any pending offset commits. The consumer must be
currently assigned the specified partition(s).partitions
- the TopicPartition
s.void seekRelative(java.lang.String topic, int partition, long offset, boolean toCurrent)
topic
- the topic.partition
- the partition.offset
- the offset; positive values are relative to the start, negative
values are relative to the end, unless toCurrent is true.toCurrent
- true for the offset to be relative to the current position rather
than the beginning or end.void seekToTimestamp(java.lang.String topic, int partition, long timestamp)
seekToTimestamp(Collection, long)
when seeking multiple partitions
because the offset lookup is blocking.topic
- the topic.partition
- the partition.timestamp
- the time stamp.seekToTimestamp(Collection, long)
void seekToTimestamp(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions, long timestamp)
topicPartitions
- the topic/partitions.timestamp
- the time stamp.