public class DebugEnabledTimedLock extends Object implements DebuggableTimedLock
Modifier and Type | Field and Description |
---|---|
private int |
iterationFrequency |
private Lock |
lock |
private Map<String,Long> |
lockIterations |
private Map<String,Long> |
lockNanos |
private long |
lockTime |
private org.slf4j.Logger |
logger |
private String |
name |
Constructor and Description |
---|
DebugEnabledTimedLock(Lock lock,
String name,
int iterationFrequency) |
Modifier and Type | Method and Description |
---|---|
void |
lock() |
boolean |
tryLock() |
boolean |
tryLock(long timeout,
TimeUnit timeUnit) |
void |
unlock(String task) |
private final Lock lock
private final org.slf4j.Logger logger
private long lockTime
private final String name
private final int iterationFrequency
public boolean tryLock()
tryLock
in interface DebuggableTimedLock
public boolean tryLock(long timeout, TimeUnit timeUnit)
tryLock
in interface DebuggableTimedLock
timeout
- duration to wait for locktimeUnit
- unit to understand given durationpublic void lock()
lock
in interface DebuggableTimedLock
public void unlock(String task)
unlock
in interface DebuggableTimedLock
task
- to release the lock forCopyright © 2024 Apache NiFi Project. All rights reserved.