private static class PoolUtils.ErodingFactor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private float |
factor
Determines frequency of "erosion" events
|
private int |
idleHighWaterMark
High water mark - largest numIdle encountered
|
private long |
nextShrink
Time of next shrink event
|
Constructor and Description |
---|
ErodingFactor(float factor)
Create a new ErodingFactor with the given erosion factor.
|
Modifier and Type | Method and Description |
---|---|
long |
getNextShrink()
Returns the time of the next erosion event.
|
java.lang.String |
toString() |
void |
update(int numIdle)
Updates internal state based on numIdle and the current time.
|
void |
update(long now,
int numIdle)
Updates internal state using the supplied time and numIdle.
|
private final float factor
private transient volatile long nextShrink
private transient volatile int idleHighWaterMark
public ErodingFactor(float factor)
factor
- erosion factorpublic void update(int numIdle)
numIdle
- number of idle elements in the poolpublic void update(long now, int numIdle)
now
- current timenumIdle
- number of idle elements in the poolpublic long getNextShrink()
public java.lang.String toString()
toString
in class java.lang.Object