Class MongoDBUIDSequencer

    • Constructor Detail

      • MongoDBUIDSequencer

        public MongoDBUIDSequencer()
    • Method Detail

      • init

        public void init()
        Description copied from interface: UIDSequencer
        Init Sequencer
      • 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
      • getSequencerCollection

        public com.mongodb.client.MongoCollection<org.bson.Document> getSequencerCollection()
      • getNextBlock

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

        protected long incrementBy​(String key,
                                   int value)
      • dispose

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