Package org.graylog2.indexer.datanode
Class DatanodeMigrationLockServiceImpl
java.lang.Object
org.graylog2.indexer.datanode.DatanodeMigrationLockServiceImpl
- All Implemented Interfaces:
DatanodeMigrationLockService
public class DatanodeMigrationLockServiceImpl
extends Object
implements DatanodeMigrationLockService
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.
-
Field Details
-
LOCK_EXTEND_PERIOD_SECONDS
public static final int LOCK_EXTEND_PERIOD_SECONDS- See Also:
-
-
Constructor Details
-
DatanodeMigrationLockServiceImpl
-
-
Method Details
-
acquireLock
public Lock acquireLock(IndexSet indexSet, Class<?> caller, String context, DatanodeMigrationLockWaitConfig config) Description copied from interface:DatanodeMigrationLockServiceThis 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.- Specified by:
acquireLockin interfaceDatanodeMigrationLockService
-
tryRun
Description copied from interface:DatanodeMigrationLockServiceWill run the runnable only if it can get a lock on the first try. If the lock is taken, it will skip the execution.- Specified by:
tryRunin interfaceDatanodeMigrationLockService
-
release
Description copied from interface:DatanodeMigrationLockServiceEach lock needs to be explicitly released, otherwise the implementation may extend it as long as the node is running.- Specified by:
releasein interfaceDatanodeMigrationLockService
-