Package com.linkedin.venice.pubsub.api
Interface PubSubPosition
-
- All Known Implementing Classes:
ApacheKafkaOffsetPosition
public interface PubSubPosition
Represents a position of a message in a partition of a topic.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description int
comparePosition(PubSubPosition other)
long
diff(PubSubPosition other)
boolean
equals(java.lang.Object obj)
static PubSubPosition
getPositionFromWireFormat(byte[] positionWireFormatBytes)
static PubSubPosition
getPositionFromWireFormat(PubSubPositionWireFormat positionWireFormat)
PubSubPositionWireFormat
getPositionWireFormat()
Position wrapper is used to wrap the position type and the position value.int
hashCode()
-
-
-
Method Detail
-
comparePosition
int comparePosition(PubSubPosition other)
- Parameters:
other
- the other position to compare to- Returns:
- returns 0 if the positions are equal, -1 if this position is less than the other position, and 1 if this position is greater than the other position
-
diff
long diff(PubSubPosition other)
- Returns:
- the difference between this position and the other position
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getPositionWireFormat
PubSubPositionWireFormat getPositionWireFormat()
Position wrapper is used to wrap the position type and the position value. This is used to serialize and deserialize the position object when sending and receiving it over the wire.- Returns:
- the position wrapper
-
getPositionFromWireFormat
static PubSubPosition getPositionFromWireFormat(byte[] positionWireFormatBytes)
-
getPositionFromWireFormat
static PubSubPosition getPositionFromWireFormat(PubSubPositionWireFormat positionWireFormat)
-
-