Class ControlRate.Throttle
java.lang.Object
java.util.concurrent.locks.ReentrantLock
org.apache.nifi.processors.standard.ControlRate.Throttle
- All Implemented Interfaces:
Serializable,Lock
- Enclosing class:
ControlRate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LongSupplierprivate longprivate final org.apache.nifi.logging.ComponentLogprivate final AtomicLongprivate longprivate longprivate final TimedBuffer<TimestampedLong> private final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateThrottle(int timePeriod, TimeUnit unit, org.apache.nifi.logging.ComponentLog logger, LongSupplier currentTimeSupplier) -
Method Summary
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
Field Details
-
maxRate
-
timePeriodMillis
private final long timePeriodMillis -
timedBuffer
-
logger
private final org.apache.nifi.logging.ComponentLog logger -
currentTimeSupplier
-
penalizationPeriod
private volatile long penalizationPeriod -
penalizationExpired
private volatile long penalizationExpired -
lastUpdateTime
private volatile long lastUpdateTime
-
-
Constructor Details
-
Throttle
private Throttle(int timePeriod, TimeUnit unit, org.apache.nifi.logging.ComponentLog logger, LongSupplier currentTimeSupplier)
-
-
Method Details
-
setMaxRate
public void setMaxRate(long maxRate) -
lastUpdateTime
public long lastUpdateTime() -
tryAdd
public boolean tryAdd(long value)
-