Class JobManager.ThrottleJobItem

  • Enclosing class:
    JobManager

    protected static class JobManager.ThrottleJobItem
    extends java.lang.Object
    This 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      ThrottleJobItem()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLimit​(java.lang.String regexp, int maxCount)
      Add a bin limit.
      void decrement​(java.lang.String binName)
      Decrement specified bin.
      JobManager.ThrottleJobItem duplicate()
      Create a duplicate of this item.
      protected int findMaxCount​(java.lang.String binName)
      Given a bin name, find the max value for it using the regexps that are in place.
      boolean isEmpty​(java.lang.String binName)
      Check if the specified bin is empty.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • ThrottleJobItem

        public ThrottleJobItem()
        Constructor.
    • 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.
      • 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.