Package com.linkedin.venice.unit.kafka
Class InMemoryPubSubPosition
java.lang.Object
com.linkedin.venice.unit.kafka.InMemoryPubSubPosition
- All Implemented Interfaces:
Measurable
,PubSubPosition
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
comparePosition
(PubSubPosition other) long
diff
(PubSubPosition other) int
long
Position wrapper is used to wrap the position type and the position value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.pubsub.api.PubSubPosition
equals, hashCode
-
Constructor Details
-
InMemoryPubSubPosition
public InMemoryPubSubPosition(long offset)
-
-
Method Details
-
comparePosition
- Specified by:
comparePosition
in interfacePubSubPosition
- 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
- Specified by:
diff
in interfacePubSubPosition
- Returns:
- the difference between this position and the other position
-
getNumericOffset
public long getNumericOffset()- Specified by:
getNumericOffset
in interfacePubSubPosition
-
getPositionWireFormat
Description copied from interface:PubSubPosition
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.- Specified by:
getPositionWireFormat
in interfacePubSubPosition
- Returns:
- the position wrapper
-
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-