java.lang.Object
org.elasticsearch.index.shard.EngineResetLock
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Returnstrue
if the number of read locks held by any thread is greater than zero.boolean
Returnstrue
if the number of holds on the read lock by the current thread is greater than zero.boolean
boolean
readLock()
-
Constructor Details
-
EngineResetLock
public EngineResetLock()
-
-
Method Details
-
writeLock
- Specified by:
writeLock
in interfaceReadWriteLock
-
readLock
- Specified by:
readLock
in interfaceReadWriteLock
-
isWriteLocked
public boolean isWriteLocked() -
isWriteLockedByCurrentThread
public boolean isWriteLockedByCurrentThread() -
isReadLocked
public boolean isReadLocked()Returnstrue
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 andfalse
otherwise
-
isReadLockedByCurrentThread
public boolean isReadLockedByCurrentThread()Returnstrue
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()
-