Class KeyValueStoreUIDSequencer

  • All Implemented Interfaces:
    UIDSequencer

    public class KeyValueStoreUIDSequencer
    extends AbstractUIDSequencer
    UID Sequencer based on a key/value store. The store is the same for all sequencers, but they are using different keys, prefixed by the sequencer name.
    Since:
    10.2
    • Constructor Detail

      • KeyValueStoreUIDSequencer

        public KeyValueStoreUIDSequencer()
    • Method Detail

      • init

        public void init()
        Description copied from interface: UIDSequencer
        Init Sequencer
      • dispose

        public void dispose()
        Description copied from interface: UIDSequencer
        Cleanup callback
      • initSequence

        public void initSequence​(String key,
                                 long id)
        Description copied from interface: UIDSequencer
        Initializes 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:
        initSequence in interface UIDSequencer
        Overrides:
        initSequence in class AbstractUIDSequencer
      • getNextBlock

        public List<Long> getNextBlock​(String key,
                                       int blockSize)
        Description copied from interface: UIDSequencer
        Returns a block containing blockSize sequences.