Interface DatanodeMigrationLockService

All Known Implementing Classes:
DatanodeMigrationLockServiceImpl

public interface DatanodeMigrationLockService
  • Method Summary

    Modifier and Type
    Method
    Description
    acquireLock(IndexSet indexSet, Class<?> caller, String context, DatanodeMigrationLockWaitConfig config)
    This is a blocking method.
    void
    release(Lock lock)
    Each lock needs to be explicitly released, otherwise the implementation may extend it as long as the node is running.
    void
    tryRun(IndexSet indexSet, Class<?> caller, Runnable runnable)
    Will run the runnable only if it can get a lock on the first try.
  • Method Details

    • acquireLock

      Lock acquireLock(IndexSet indexSet, Class<?> caller, String context, DatanodeMigrationLockWaitConfig config)
      This is a blocking method. It will try to acquire a lock and repeat the process until the general timeout defined in the DatanodeMigrationLockWaitConfig.lockAcquireTimeout() is reached.
    • tryRun

      void tryRun(IndexSet indexSet, Class<?> caller, Runnable runnable)
      Will run the runnable only if it can get a lock on the first try. If the lock is taken, it will skip the execution.
    • release

      void release(Lock lock)
      Each lock needs to be explicitly released, otherwise the implementation may extend it as long as the node is running.