Class ReleasableLock

java.lang.Object
org.elasticsearch.common.util.concurrent.ReleasableLock
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, Releasable

public class ReleasableLock
extends java.lang.Object
implements Releasable
Releasable lock used inside of Engine implementations
  • Constructor Summary

    Constructors
    Constructor Description
    ReleasableLock​(java.util.concurrent.locks.Lock lock)  
  • Method Summary

    Modifier and Type Method Description
    ReleasableLock acquire()  
    void close()  
    boolean isHeldByCurrentThread()  
    ReleasableLock tryAcquire()
    Try acquiring lock, returning null if unable.
    ReleasableLock tryAcquire​(org.elasticsearch.common.unit.TimeValue timeout)
    Try acquiring lock, returning null if unable to acquire lock within timeout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReleasableLock

      public ReleasableLock​(java.util.concurrent.locks.Lock lock)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Specified by:
      close in interface Releasable
    • acquire

      public ReleasableLock acquire() throws EngineException
      Throws:
      EngineException
    • tryAcquire

      public ReleasableLock tryAcquire()
      Try acquiring lock, returning null if unable.
    • tryAcquire

      public ReleasableLock tryAcquire​(org.elasticsearch.common.unit.TimeValue timeout) throws java.lang.InterruptedException
      Try acquiring lock, returning null if unable to acquire lock within timeout.
      Throws:
      java.lang.InterruptedException
    • isHeldByCurrentThread

      public boolean isHeldByCurrentThread()