Class PollerAutoScaler
- java.lang.Object
-
- com.uber.cadence.internal.worker.autoscaler.PollerAutoScaler
-
- All Implemented Interfaces:
AutoScaler
public class PollerAutoScaler extends java.lang.Object implements AutoScaler
-
-
Constructor Summary
Constructors Constructor Description PollerAutoScaler(java.time.Duration coolDownTime, PollerUsageEstimator pollerUsageEstimator, Recommender recommender)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquire()
Reduce the number of available locks.protected int
getSemaphoreSize()
void
increaseActionablePollCount()
void
increaseNoopPollCount()
void
release()
Releases lock into the autoscaler pool.protected void
resizePollers()
void
start()
void
stop()
-
-
-
Constructor Detail
-
PollerAutoScaler
public PollerAutoScaler(java.time.Duration coolDownTime, PollerUsageEstimator pollerUsageEstimator, Recommender recommender)
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceAutoScaler
-
stop
public void stop()
- Specified by:
stop
in interfaceAutoScaler
-
resizePollers
protected void resizePollers()
-
acquire
public void acquire() throws java.lang.InterruptedException
Description copied from interface:AutoScaler
Reduce the number of available locks. Intended to be blocking operation until lock is acquired.- Specified by:
acquire
in interfaceAutoScaler
- Throws:
java.lang.InterruptedException
-
release
public void release()
Description copied from interface:AutoScaler
Releases lock into the autoscaler pool. Release should be always called in same process, failing to do so is considered a usage error.- Specified by:
release
in interfaceAutoScaler
-
increaseNoopPollCount
public void increaseNoopPollCount()
- Specified by:
increaseNoopPollCount
in interfaceAutoScaler
-
increaseActionablePollCount
public void increaseActionablePollCount()
- Specified by:
increaseActionablePollCount
in interfaceAutoScaler
-
getSemaphoreSize
protected int getSemaphoreSize()
-
-