Package com.linkedin.venice.offsets
Class DeepCopyOffsetManager
- java.lang.Object
-
- com.linkedin.venice.offsets.DeepCopyOffsetManager
-
- All Implemented Interfaces:
OffsetManager
- Direct Known Subclasses:
DeepCopyStorageMetadataService
public class DeepCopyOffsetManager extends java.lang.Object implements OffsetManager
This class is used to systematically copyOffsetRecord
instances rather than passing them as is. This is necessary in TestAdminConsumptionTask and StoreConsumptionTaskTest.
-
-
Constructor Summary
Constructors Constructor Description DeepCopyOffsetManager(OffsetManager delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearOffset(java.lang.String topicName, int partitionId)
OffsetRecord
getLastOffset(java.lang.String topicName, int partitionId)
Gets the Last Known persisted offset of this consumer.void
put(java.lang.String topicName, int partitionId, OffsetRecord record)
Records the offset with underlying/external storage.
-
-
-
Constructor Detail
-
DeepCopyOffsetManager
public DeepCopyOffsetManager(OffsetManager delegate)
-
-
Method Detail
-
put
public void put(java.lang.String topicName, int partitionId, OffsetRecord record) throws VeniceException
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
public void clearOffset(java.lang.String topicName, int partitionId)
- Specified by:
clearOffset
in interfaceOffsetManager
-
getLastOffset
public OffsetRecord getLastOffset(java.lang.String topicName, int partitionId) throws VeniceException
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
-
-