DataNodeLockManager (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.common, interface: DataNodeLockManager

Package org.apache.hadoop.hdfs.server.common

# Interface DataNodeLockManager<T extends AutoCloseDataSetLock>

All Known Implementing Classes:
  `DataSetLockManager`, `NoLockManager`

public interface DataNodeLockManager<T extends AutoCloseDataSetLock>
Use for manage a set of lock for datanode.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static enum`
  `DataNodeLockManager.LockLevel`
  Acquire block pool level and volume level lock first if you want to acquire dir lock.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addLock(DataNodeLockManager.LockLevel level, String... resources)`
  Add a lock to LockManager.
  `void`
  `hook()`
  LockManager may need to back hook.
  `T`
  `readLock(DataNodeLockManager.LockLevel level, String... resources)`
  Acquire readLock and then lock.
  `void`
  `removeLock(DataNodeLockManager.LockLevel level, String... resources)`
  Remove a lock from LockManager.
  `T`
  `writeLock(DataNodeLockManager.LockLevel level, String... resources)`
  Acquire writeLock and then lock.

- ## Method Details

  - ### readLock

    T readLock(DataNodeLockManager.LockLevel level, String... resources)
    Acquire readLock and then lock.

  - ### writeLock

    T writeLock(DataNodeLockManager.LockLevel level, String... resources)
    Acquire writeLock and then lock.

  - ### addLock

    void addLock(DataNodeLockManager.LockLevel level, String... resources)
    Add a lock to LockManager.

  - ### removeLock

    void removeLock(DataNodeLockManager.LockLevel level, String... resources)
    Remove a lock from LockManager.

  - ### hook

    void hook()
    LockManager may need to back hook.