def init(self, initial):
        """
        Try to initialize this IdGenerator instance with the given id. The first generated id will be 1 greater than id.

        :param initial: (long), the given id.
        :return: (bool), ``true`` if initialization succeeded, ``false`` if id is less than 0.
        """
        if initial <= 0:
            return False
        step = initial // BLOCK_SIZE
        with self._lock:
            init = self._atomic_long.compare_and_set(0, step + 1).result()
            if init:
                self._local = step
                self._residue = (initial % BLOCK_SIZE) + 1
            return init
def init ( self , initial ) : if initial <= 0 : return False step = initial // BLOCK_SIZE with self . _lock : init = self . _atomic_long . compare_and_set ( 0 , step + 1 ) . result ( ) if init : self . _local = step self . _residue = ( initial % BLOCK_SIZE ) + 1 return init
Try to initialize this IdGenerator instance with the given id. The first generated id will be 1 greater than id.

        :param initial: (long), the given id.
        :return: (bool), ``true`` if initialization succeeded, ``false`` if id is less than 0.