Package com.linkedin.venice.pubsub.api
Interface PubSubPosition
- All Superinterfaces:
Measurable
- All Known Implementing Classes:
ApacheKafkaOffsetPosition
,InMemoryPubSubPosition
Represents a position of a message in a partition of a topic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final InternalAvroSpecificSerializer<PubSubPositionWireFormat>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Class<? extends PubSubPositionFactory>
Returns the factory class responsible for creating this position type.default String
long
Position wrapper is used to wrap the position type and the position value.int
hashCode()
default boolean
default ByteBuffer
Returns the serialized wire format bytes of this position.default byte[]
Serializes this position to a wire format and returns the result as a byte array.Methods inherited from interface com.linkedin.venice.memory.Measurable
getHeapSize
-
Field Details
-
PUBSUB_POSITION_WIRE_FORMAT_SERIALIZER
static final InternalAvroSpecificSerializer<PubSubPositionWireFormat> PUBSUB_POSITION_WIRE_FORMAT_SERIALIZER
-
-
Method Details
-
getNumericOffset
long getNumericOffset() -
equals
-
hashCode
int hashCode() -
isSymbolic
default boolean isSymbolic() -
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
-
toWireFormatBuffer
Returns the serialized wire format bytes of this position.- Returns:
- byte array representing the position in wire format
-
toWireFormatBytes
default byte[] toWireFormatBytes()Serializes this position to a wire format and returns the result as a byte array. This method bypasses ByteBuffer and directly returns the backing array.- Returns:
- a byte array representing the serialized wire format of this position
-
getFactoryClass
Class<? extends PubSubPositionFactory> getFactoryClass()Returns the factory class responsible for creating this position type. This enables strong type checking and reflection-based instantiation without requiring the actual factory instance to be returned.- Returns:
- the class object of the factory that can construct this position
-
getFactoryClassName
-