Package org.graylog2.indexer.datanode
Interface DatanodeMigrationLockService
- All Known Implementing Classes:
DatanodeMigrationLockServiceImpl
public interface DatanodeMigrationLockService
-
Method Summary
Modifier and TypeMethodDescriptionacquireLock(IndexSet indexSet, Class<?> caller, String context, DatanodeMigrationLockWaitConfig config) This is a blocking method.voidEach lock needs to be explicitly released, otherwise the implementation may extend it as long as the node is running.voidWill 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 theDatanodeMigrationLockWaitConfig.lockAcquireTimeout()is reached. -
tryRun
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
Each lock needs to be explicitly released, otherwise the implementation may extend it as long as the node is running.
-