public class TopicPartitionInitialOffset
extends java.lang.Object
null
- do nothing;0
) - seek to EITHER the absolute offset within the
partition or an offset relative to the current position for this consumer, depending
on isRelativeToCurrent()
.
consumer.seekToEnd() + initialOffset
OR the relative to the
current offset for this consumer (if any), depending on
isRelativeToCurrent()
.start()
ed.Modifier and Type | Class and Description |
---|---|
static class |
TopicPartitionInitialOffset.SeekPosition
Enumeration for "special" seeks.
|
Constructor and Description |
---|
TopicPartitionInitialOffset(java.lang.String topic,
int partition)
Construct an instance with no initial offset management.
|
TopicPartitionInitialOffset(java.lang.String topic,
int partition,
java.lang.Long initialOffset)
Construct an instance with the provided initial offset with
isRelativeToCurrent() false. |
TopicPartitionInitialOffset(java.lang.String topic,
int partition,
java.lang.Long initialOffset,
boolean relativeToCurrent)
Construct an instance with the provided initial offset.
|
TopicPartitionInitialOffset(java.lang.String topic,
int partition,
TopicPartitionInitialOffset.SeekPosition position)
Construct an instance with the provided
TopicPartitionInitialOffset.SeekPosition . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
TopicPartitionInitialOffset.SeekPosition |
getPosition() |
int |
hashCode() |
java.lang.Long |
initialOffset() |
boolean |
isRelativeToCurrent() |
int |
partition() |
java.lang.String |
topic() |
org.apache.kafka.common.TopicPartition |
topicPartition() |
java.lang.String |
toString() |
public TopicPartitionInitialOffset(java.lang.String topic, int partition)
topic
- the topic.partition
- the partition.public TopicPartitionInitialOffset(java.lang.String topic, int partition, java.lang.Long initialOffset)
isRelativeToCurrent()
false.topic
- the topic.partition
- the partition.initialOffset
- the initial offset.TopicPartitionInitialOffset(String, int, Long, boolean)
public TopicPartitionInitialOffset(java.lang.String topic, int partition, java.lang.Long initialOffset, boolean relativeToCurrent)
topic
- the topic.partition
- the partition.initialOffset
- the initial offset.relativeToCurrent
- true for the initial offset to be relative to
the current consumer position, false for a positive initial offset to
be absolute and a negative offset relative to the current end of the
partition.public TopicPartitionInitialOffset(java.lang.String topic, int partition, TopicPartitionInitialOffset.SeekPosition position)
TopicPartitionInitialOffset.SeekPosition
.topic
- the topic.partition
- the partition.position
- TopicPartitionInitialOffset.SeekPosition
.public org.apache.kafka.common.TopicPartition topicPartition()
public int partition()
public java.lang.String topic()
public java.lang.Long initialOffset()
public boolean isRelativeToCurrent()
public TopicPartitionInitialOffset.SeekPosition getPosition()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object