Class ResourceLockImpl<T>

java.lang.Object
org.apache.pulsar.metadata.coordination.impl.ResourceLockImpl<T>
All Implemented Interfaces:
ResourceLock<T>

public class ResourceLockImpl<T> extends Object implements ResourceLock<T>
  • Method Details

    • getValue

      public T getValue()
      Specified by:
      getValue in interface ResourceLock<T>
      Returns:
      the value associated with the lock
    • updateValue

      public CompletableFuture<Void> updateValue(T newValue)
      Description copied from interface: ResourceLock
      Update the value of the lock.
      Specified by:
      updateValue in interface ResourceLock<T>
      Returns:
      a future to track when the release operation is complete
    • release

      public CompletableFuture<Void> release()
      Description copied from interface: ResourceLock
      Release the lock on the resource.
      Specified by:
      release in interface ResourceLock<T>
      Returns:
      a future to track when the release operation is complete
    • getLockExpiredFuture

      public CompletableFuture<Void> getLockExpiredFuture()
      Description copied from interface: ResourceLock
      Get a future that can be used to get notified when the lock is expired or it gets released.
      Specified by:
      getLockExpiredFuture in interface ResourceLock<T>
      Returns:
      a future to get notification if the lock is expired
    • getPath

      public String getPath()
      Specified by:
      getPath in interface ResourceLock<T>
      Returns:
      the path associated with the lock
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object