Class JobManager.ThrottleJobItem
- java.lang.Object
-
- org.apache.manifoldcf.crawler.jobs.JobManager.ThrottleJobItem
-
- Enclosing class:
- JobManager
protected static class JobManager.ThrottleJobItem extends java.lang.ObjectThis class represents the information stored PER JOB in the throttling structure. In this structure, "remaining" counts are kept for each bin. When the bin becomes empty, then no more documents that would map to that bin will be returned, for this query. The way in which the maximum count per bin is determined is not part of this class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,JobManager.MutableInteger>binCountsThis is a map of the bins and their current counts.protected java.util.List<JobManager.ThrottleLimitSpec>throttleLimitsThese are the bin limits.
-
Constructor Summary
Constructors Constructor Description ThrottleJobItem()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLimit(java.lang.String regexp, int maxCount)Add a bin limit.voiddecrement(java.lang.String binName)Decrement specified bin.JobManager.ThrottleJobItemduplicate()Create a duplicate of this item.protected intfindMaxCount(java.lang.String binName)Given a bin name, find the max value for it using the regexps that are in place.booleanisEmpty(java.lang.String binName)Check if the specified bin is empty.
-
-
-
Field Detail
-
throttleLimits
protected java.util.List<JobManager.ThrottleLimitSpec> throttleLimits
These are the bin limits. This is an array of ThrottleLimitSpec objects.
-
binCounts
protected final java.util.Map<java.lang.String,JobManager.MutableInteger> binCounts
This is a map of the bins and their current counts. If an entry doesn't exist, it's considered to be the same as maxBinCount.
-
-
Method Detail
-
addLimit
public void addLimit(java.lang.String regexp, int maxCount)Add a bin limit.- Parameters:
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.
-
duplicate
public JobManager.ThrottleJobItem duplicate()
Create a duplicate of this item.- Returns:
- the duplicate.
-
isEmpty
public boolean isEmpty(java.lang.String binName)
Check if the specified bin is empty.- Parameters:
binName- is the bin name.- Returns:
- true if empty.
-
decrement
public void decrement(java.lang.String binName)
Decrement specified bin.- Parameters:
binName- is the bin name.
-
findMaxCount
protected int findMaxCount(java.lang.String binName)
Given a bin name, find the max value for it using the regexps that are in place.- Parameters:
binName- is the bin name.- Returns:
- the max count for that bin, or -1 if infinite.
-
-