Package com.linkedin.venice.offsets
Class DeepCopyOffsetManager
java.lang.Object
com.linkedin.venice.offsets.DeepCopyOffsetManager
- All Implemented Interfaces:
OffsetManager
- Direct Known Subclasses:
DeepCopyStorageMetadataService
This class is used to systematically copy
OffsetRecord instances rather than
passing them as is. This is necessary in TestAdminConsumptionTask and StoreConsumptionTaskTest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearOffset(String topicName, int partitionId) getLastOffset(String topicName, int partitionId, PubSubContext pubSubContext) Gets the Last Known persisted offset of this consumer.voidput(String topicName, int partitionId, OffsetRecord record) Records the offset with underlying/external storage.
-
Constructor Details
-
DeepCopyOffsetManager
-
-
Method Details
-
put
Description copied from interface:OffsetManagerRecords 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:
putin 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:
clearOffsetin interfaceOffsetManager
-
getLastOffset
public OffsetRecord getLastOffset(String topicName, int partitionId, PubSubContext pubSubContext) throws VeniceException Description copied from interface:OffsetManagerGets the Last Known persisted offset of this consumer.- Specified by:
getLastOffsetin 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.pubSubContext- PubSubContext for passing PubSub related dependencies- Returns:
- OffsetRecord - contains offset and time when it was recorded before the consumer thread went down. consumer
- Throws:
VeniceException
-