protected static class JobManager.ThrottleJobItem extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,JobManager.MutableInteger> |
binCounts
This is a map of the bins and their current counts.
|
protected List<JobManager.ThrottleLimitSpec> |
throttleLimits
These are the bin limits.
|
Constructor and Description |
---|
JobManager.ThrottleJobItem()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addLimit(String regexp,
int maxCount)
Add a bin limit.
|
void |
decrement(String binName)
Decrement specified bin.
|
JobManager.ThrottleJobItem |
duplicate()
Create a duplicate of this item.
|
protected int |
findMaxCount(String binName)
Given a bin name, find the max value for it using the regexps that are in place.
|
boolean |
isEmpty(String binName)
Check if the specified bin is empty.
|
protected List<JobManager.ThrottleLimitSpec> throttleLimits
protected final Map<String,JobManager.MutableInteger> binCounts
public void addLimit(String regexp, int maxCount)
regexp
- is the regular expression describing the bins to which the limit applies to.maxCount
- is the maximum number of fetches allowed for that bin.public JobManager.ThrottleJobItem duplicate()
public boolean isEmpty(String binName)
binName
- is the bin name.public void decrement(String binName)
binName
- is the bin name.protected int findMaxCount(String binName)
binName
- is the bin name.