Package org.apache.hadoop.util
Class InstrumentedWriteLock
java.lang.Object
org.apache.hadoop.util.InstrumentedLock
org.apache.hadoop.util.InstrumentedWriteLock
- All Implemented Interfaces:
Lock
This is a wrap class of a
WriteLock.
It extends the class InstrumentedLock, and can be used to track
whether a specific write lock is being held for too long and log
warnings if so.
The logged warnings are throttled so that logs are not spammed.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.util.InstrumentedLock
InstrumentedLock.SuppressedSnapshot -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentedWriteLock(String name, org.slf4j.Logger logger, ReentrantReadWriteLock readWriteLock, long minLoggingGapMs, long lockWarningThresholdMs) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidStarts timing for the instrumented write lock.voidunlock()Methods inherited from class org.apache.hadoop.util.InstrumentedLock
check, getLock, getTimer, lock, lockInterruptibly, newCondition, tryLock, tryLock
-
Constructor Details
-
InstrumentedWriteLock
public InstrumentedWriteLock(String name, org.slf4j.Logger logger, ReentrantReadWriteLock readWriteLock, long minLoggingGapMs, long lockWarningThresholdMs)
-
-
Method Details
-
unlock
public void unlock()- Specified by:
unlockin interfaceLock- Overrides:
unlockin classInstrumentedLock
-
startLockTiming
protected void startLockTiming()Starts timing for the instrumented write lock.- Overrides:
startLockTimingin classInstrumentedLock
-