Package com.linkedin.venice.offsets
Class InMemoryOffsetManager
java.lang.Object
com.linkedin.venice.offsets.InMemoryOffsetManager
- All Implemented Interfaces:
OffsetManager
- Direct Known Subclasses:
InMemoryStorageMetadataService
In memory implementation of OffsetManager, should really only be used for tests
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearOffset
(String topicName, int partitionId) getLastOffset
(String topicName, int partitionId) Gets the Last Known persisted offset of this consumer.void
put
(String topicName, int partitionId, OffsetRecord record) Records the offset with underlying/external storage.
-
Constructor Details
-
InMemoryOffsetManager
public InMemoryOffsetManager()
-
-
Method Details
-
put
Description copied from interface:OffsetManager
Records the offset with underlying/external storage. Persistence to disk happens in configurable time interval by a background thread. For example in case of BDB the check pointer thread can be configured to do this.- Specified by:
put
in interfaceOffsetManager
- Parameters:
topicName
- kafka topic to which the consumer thread is registered to.partitionId
- kafka partition id for which the consumer thread is registered to.record
- OffSetRecord containing last read offset for the topic and partition combination.- Throws:
VeniceException
-
clearOffset
- Specified by:
clearOffset
in interfaceOffsetManager
-
getLastOffset
Description copied from interface:OffsetManager
Gets the Last Known persisted offset of this consumer.- Specified by:
getLastOffset
in interfaceOffsetManager
- Parameters:
topicName
- kafka topic to which the consumer thread is registered to.partitionId
- kafka partition id for which the consumer thread is registered to.- Returns:
- OffsetRecord - contains offset and time when it was recorded before the consumer thread went down. consumer
- Throws:
VeniceException
-