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 TypeMethodDescriptionintbooleanReturnstrueif the number of read locks held by any thread is greater than zero.booleanReturnstrueif the number of holds on the read lock by the current thread is greater than zero.booleanbooleanreadLock()
-
Constructor Details
-
EngineResetLock
public EngineResetLock()
-
-
Method Details
-
writeLock
- Specified by:
writeLockin interfaceReadWriteLock
-
readLock
- Specified by:
readLockin interfaceReadWriteLock
-
isWriteLocked
public boolean isWriteLocked() -
isWriteLockedByCurrentThread
public boolean isWriteLockedByCurrentThread() -
isReadLocked
public boolean isReadLocked()Returnstrueif 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:
trueif any thread holds a read lock andfalseotherwise
-
isReadLockedByCurrentThread
public boolean isReadLockedByCurrentThread()Returnstrueif 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:
trueif the number of holds on the read lock by the current thread is greater than zero,falseotherwise
-
getReadLockCount
public int getReadLockCount()
-