Class BatchingIDGenerator
- java.lang.Object
-
- org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator
-
- All Implemented Interfaces:
IDGenerator
public final class BatchingIDGenerator extends Object implements IDGenerator
An ID generator that allocates a batch of IDs of sizecheckpointSizeand records the ID in the journal only when starting a new batch.- See Also:
IDGenerator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBatchingIDGenerator.IDCounterEncoding
-
Constructor Summary
Constructors Constructor Description BatchingIDGenerator(long start, long checkpointSize, StorageManager storageManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()A method to cleanup old records after startedstatic EncodingSupportcreateIDEncodingSupport(long id)voidforceNextID(long nextID)longgenerateID()longgetCurrentID()voidloadState(long journalID, ActiveMQBuffer buffer)voidpersistCurrentID()
-
-
-
Constructor Detail
-
BatchingIDGenerator
public BatchingIDGenerator(long start, long checkpointSize, StorageManager storageManager)
-
-
Method Detail
-
persistCurrentID
public void persistCurrentID()
-
cleanup
public void cleanup()
A method to cleanup old records after started
-
loadState
public void loadState(long journalID, ActiveMQBuffer buffer)
-
forceNextID
public void forceNextID(long nextID)
-
generateID
public long generateID()
- Specified by:
generateIDin interfaceIDGenerator
-
getCurrentID
public long getCurrentID()
- Specified by:
getCurrentIDin interfaceIDGenerator
-
createIDEncodingSupport
public static EncodingSupport createIDEncodingSupport(long id)
-
-