Interface DistributedLock

    • Method Detail

      • lock

        Version lock()
        Acquires the lock, blocking until it's available.
        Returns:
        the acquired lock version
      • tryLock

        Optional<Version> tryLock()
        Attempts to acquire the lock.
        Returns:
        indicates whether the lock was acquired
      • tryLock

        Optional<Version> tryLock​(Duration timeout)
        Attempts to acquire the lock for a specified amount of time.
        Parameters:
        timeout - the timeout after which to give up attempting to acquire the lock
        Returns:
        indicates whether the lock was acquired
      • unlock

        void unlock()
        Unlocks the lock.