Class PriorityCalculator
- java.lang.Object
-
- org.apache.manifoldcf.crawler.system.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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PriorityCalculator.ThrottleLimits
This class represents the throttle limits out of the connection specificationprotected static class
PriorityCalculator.ThrottleLimitSpec
This is a class which describes an individual throttle limit, in fetches per millisecond.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected double[]
binCountScaleFactors
protected java.lang.String[]
binNames
protected java.lang.Double
cachedValue
protected IRepositoryConnection
connection
protected java.lang.String
documentIdentifier
protected IReprioritizationTracker
rt
protected double[]
weightedMinimumDepths
-
Constructor Summary
Constructors Constructor Description PriorityCalculator(IReprioritizationTracker rt, double currentMinimumDepth, IRepositoryConnection connection, java.lang.String[] documentBins, java.lang.String documentIdentifier)
PriorityCalculator(IReprioritizationTracker rt, IRepositoryConnection connection, java.lang.String[] documentBins, java.lang.String documentIdentifier)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.double
getDocumentPriority()
Calculate a document priority value.void
makePreloadRequest()
Log a preload request for this priority value.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
connection
protected final IRepositoryConnection connection
-
binNames
protected final java.lang.String[] binNames
-
documentIdentifier
protected final java.lang.String documentIdentifier
-
rt
protected final IReprioritizationTracker rt
-
binCountScaleFactors
protected final double[] binCountScaleFactors
-
weightedMinimumDepths
protected final double[] weightedMinimumDepths
-
cachedValue
protected java.lang.Double cachedValue
-
-
Constructor Detail
-
PriorityCalculator
public PriorityCalculator(IReprioritizationTracker rt, IRepositoryConnection connection, java.lang.String[] documentBins, java.lang.String documentIdentifier) throws ManifoldCFException
Constructor.- Throws:
ManifoldCFException
-
PriorityCalculator
public PriorityCalculator(IReprioritizationTracker rt, double currentMinimumDepth, IRepositoryConnection connection, java.lang.String[] documentBins, java.lang.String documentIdentifier) throws ManifoldCFException
- Throws:
ManifoldCFException
-
-
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 interfaceIPriorityCalculator
- 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.
-
-