public class KafkaTrackingToken extends Object implements TrackingToken, Serializable
| Modifier and Type | Method and Description |
|---|---|
KafkaTrackingToken |
advancedTo(int partition,
long offset) |
boolean |
covers(TrackingToken other)
Indicates whether this token covers the
other token completely. |
static KafkaTrackingToken |
emptyToken() |
boolean |
equals(Object o) |
int |
hashCode() |
static boolean |
isEmpty(KafkaTrackingToken token) |
static boolean |
isNotEmpty(KafkaTrackingToken token) |
TrackingToken |
lowerBound(TrackingToken other)
Returns a token that represents the lower bound between this and the
other token. |
static KafkaTrackingToken |
newInstance(Map<Integer,Long> partitionPositions) |
static org.apache.kafka.common.TopicPartition |
partition(String topic,
int partitionNumber) |
Map<Integer,Long> |
partitionPositions() |
Collection<org.apache.kafka.common.TopicPartition> |
partitions(String topic) |
String |
toString() |
TrackingToken |
upperBound(TrackingToken other)
Returns the token that represents the furthest possible position in a stream that either this token or the given
other represents. |
public static KafkaTrackingToken newInstance(Map<Integer,Long> partitionPositions)
public static KafkaTrackingToken emptyToken()
public Collection<org.apache.kafka.common.TopicPartition> partitions(String topic)
public static org.apache.kafka.common.TopicPartition partition(String topic, int partitionNumber)
public KafkaTrackingToken advancedTo(int partition, long offset)
public TrackingToken lowerBound(TrackingToken other)
TrackingTokenother token. Effectively, the
returned token will cause messages not received by both this and the other token to be redelivered.lowerBound in interface TrackingTokenother - The token to compare to this onepublic TrackingToken upperBound(TrackingToken other)
TrackingTokenother represents. Effectively, this means this token will only deliver messages that neither this, nor
the other have been received.upperBound in interface TrackingTokenother - The token to compare this token topublic boolean covers(TrackingToken other)
TrackingTokenother token completely. That means that this token represents a
position in a stream that has received all of the messages that a stream represented by the other token
has received.covers in interface TrackingTokenother - The token to compare to this onetrue if this token covers the other, otherwise falsepublic static boolean isEmpty(KafkaTrackingToken token)
public static boolean isNotEmpty(KafkaTrackingToken token)
Copyright © 2010–2018. All rights reserved.