Class PriorityCalculator

  • All Implemented Interfaces:
    IPriorityCalculator

    public class PriorityCalculator
    extends java.lang.Object
    implements IPriorityCalculator
    This class calculates a document priority given all the required inputs. It is not thread safe, but calls classes that are (e.g. QueueTracker).
    • Field Detail

      • binNames

        protected final java.lang.String[] binNames
      • documentIdentifier

        protected final java.lang.String documentIdentifier
      • binCountScaleFactors

        protected final double[] binCountScaleFactors
      • weightedMinimumDepths

        protected final double[] weightedMinimumDepths
      • cachedValue

        protected java.lang.Double cachedValue
    • Method Detail

      • makePreloadRequest

        public void makePreloadRequest()
        Log a preload request for this priority value.
      • getDocumentPriority

        public double getDocumentPriority()
                                   throws ManifoldCFException
        Calculate a document priority value. Priorities are reversed, and in log space, so that zero (0.0) is considered the highest possible priority, and larger priority values are considered lower in actual priority.
        Specified by:
        getDocumentPriority in interface IPriorityCalculator
        Returns:
        the priority value, based on recent history. Also updates statistics atomically.
        Throws:
        ManifoldCFException
      • calculateMaxFetchRates

        protected static double[] calculateMaxFetchRates​(java.lang.String[] binNames,
                                                         IRepositoryConnection connection)
        Calculate the maximum fetch rate for a given set of bins for a given connection. This is used to adjust the final priority of a document.