Package org.nuxeo.uidgen.opensearch1
Class OpenSearchUIDSequencer
java.lang.Object
org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
org.nuxeo.uidgen.opensearch1.OpenSearchUIDSequencer
- All Implemented Interfaces:
UIDSequencer
OpenSearch 1.x implementation of
UIDSequencer.
Since elasticsearch does not seem to support a notion of native sequence, the implementation uses the auto-increment of the version attribute as described in the ElasticSearch::Sequence - a blazing fast ticket server blog post.
- Since:
- 7.3
- Implementation Note:
- since 2025 it has been reworked to be OpenSearch instead of ElasticSearch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OpenSearchClientprotected static final Stringprotected static final Stringprotected Stringprotected static final intFields inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
nameFields inherited from interface org.nuxeo.ecm.core.uidgen.UIDSequencer
SEQUENCE_DOES_NOT_EXIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Cleanup callbacklonggetCurrent(String sequenceName) getKeys()getNextBlock(String key, int blockSize) Returns a block containingblockSizesequences.protected longgetNextBlockWithRetry(String key, int blockSize) longgetNextLong(String sequenceName) For the given key returns the incremented UID which is also stored in the same sequence entry.voidinit()Init SequencervoidinitSequence(String key, long id) Initializes the sequencer with the given key to at least the given long id.protected static voidvalidateKey(String key) Methods inherited from class org.nuxeo.ecm.core.uidgen.AbstractUIDSequencer
getName, setName
-
Field Details
-
DEFAULT_INDEX_NAME
- See Also:
-
INDEX_NAME_PATTERN_CONFIGURATION_KEY
- See Also:
-
MAX_RETRY
protected static final int MAX_RETRY- See Also:
-
client
-
indexName
-
-
Constructor Details
-
OpenSearchUIDSequencer
public OpenSearchUIDSequencer()
-
-
Method Details
-
init
public void init()Description copied from interface:UIDSequencerInit Sequencer -
dispose
public void dispose()Description copied from interface:UIDSequencerCleanup callback -
initSequence
Description copied from interface:UIDSequencerInitializes the sequencer with the given key to at least the given long id.A sequence can only be incremented, so if its current id is greater than the given id the sequence won't be decremented to reach the given id.
- Specified by:
initSequencein interfaceUIDSequencer- Overrides:
initSequencein classAbstractUIDSequencer
-
getKeys
- Returns:
- all keys known to this sequencer
-
getCurrent
- Returns:
- the current sequence value for the given key, or
UIDSequencer.SEQUENCE_DOES_NOT_EXISTif the sequence doesn't exist
-
getNextLong
Description copied from interface:UIDSequencerFor the given key returns the incremented UID which is also stored in the same sequence entry. This is a "one time use" function for a document. -
getNextBlock
Description copied from interface:UIDSequencerReturns a block containingblockSizesequences. -
getNextBlockWithRetry
-
validateKey
-