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
-
Method Summary
Modifier and TypeMethodDescriptionacquire()
void
close()
boolean
Try 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in 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()
-