Class EngineResetLock

java.lang.Object
org.elasticsearch.index.shard.EngineResetLock
All Implemented Interfaces:
ReadWriteLock

public final class EngineResetLock extends Object implements ReadWriteLock
Reentrant read/write lock used to control accesses to a shard's engine that can be reset. Implemented as a simple wrapper around a ReentrantReadWriteLock to make it easier to add/override methods.
  • Constructor Details

    • EngineResetLock

      public EngineResetLock()
  • Method Details

    • writeLock

      public Lock writeLock()
      Specified by:
      writeLock in interface ReadWriteLock
    • readLock

      public Lock readLock()
      Specified by:
      readLock in interface ReadWriteLock
    • isWriteLocked

      public boolean isWriteLocked()
    • isWriteLockedByCurrentThread

      public boolean isWriteLockedByCurrentThread()
    • isReadLocked

      public boolean isReadLocked()
      Returns true if the number of read locks held by any thread is greater than zero. This method is designed for use in monitoring system state, not for synchronization control.
      Returns:
      true if any thread holds a read lock and false otherwise
    • isReadLockedByCurrentThread

      public boolean isReadLockedByCurrentThread()
      Returns true if the number of holds on the read lock by the current thread is greater than zero. This method is designed for use in monitoring system state, not for synchronization control.
      Returns:
      true if the number of holds on the read lock by the current thread is greater than zero, false otherwise
    • getReadLockCount

      public int getReadLockCount()