Class ReleasableLock
java.lang.Object
org.elasticsearch.common.util.concurrent.ReleasableLock
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable
Releasable lock used inside of Engine implementations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquire()voidclose()booleanTry acquiring lock, returning null if unable.tryAcquire(org.elasticsearch.core.TimeValue timeout)Try acquiring lock, returning null if unable to acquire lock within timeout.
-
Constructor Details
-
ReleasableLock
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
acquire
- Throws:
EngineException
-
tryAcquire
Try acquiring lock, returning null if unable. -
tryAcquire
public ReleasableLock tryAcquire(org.elasticsearch.core.TimeValue timeout) throws InterruptedExceptionTry acquiring lock, returning null if unable to acquire lock within timeout.- Throws:
InterruptedException
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-