Class ReprioritizationTracker
- java.lang.Object
-
- org.apache.manifoldcf.crawler.reprioritizationtracker.ReprioritizationTracker
-
- All Implemented Interfaces:
IReprioritizationTracker
public class ReprioritizationTracker extends java.lang.Object implements IReprioritizationTracker
This class tracks cluster-wide reprioritization operations. These operations are driven forward by whatever thread needs them, and are completed if those processes die by the threads that clean up after the original process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ReprioritizationTracker.PreloadedValues
A set of preloaded valuesprotected static class
ReprioritizationTracker.PreloadKey
Connector class name, bin name pairprotected static class
ReprioritizationTracker.PreloadRequest
A preload request
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected IBinManager
binManager
protected ILockManager
lockManager
Lock managerprotected java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadedValues>
preloadedValues
Preload valuesprotected java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadRequest>
preloadRequests
Preload requestsprotected static java.lang.String
trackerMinimumDepthResource
protected static java.lang.String
trackerProcessIDResource
protected static java.lang.String
trackerReproIDResource
protected static java.lang.String
trackerWriteLock
-
Constructor Summary
Constructors Constructor Description ReprioritizationTracker(IThreadContext threadContext)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPreloadRequest(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth)
Note preload amounts.void
assessMinimumDepth(java.lang.Double[] binNamesSet)
Assess the current minimum depth.void
clearPreloadedValues()
Clear remaining preloaded values.void
clearPreloadRequests()
Clear any preload requests.void
doneReprioritization(java.lang.String reproID)
Complete a reprioritization activity.double
getIncrementBinValue(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth)
Get a bin value.double
getMinimumDepth()
Retrieve current minimum depth.java.lang.String
isSpecifiedProcessReprioritizing(java.lang.String processID)
Check if the specified processID is the one performing reprioritization.void
preloadBinValues()
Preload bin values.protected double
readMinimumDepth()
Read minimum depth.protected java.lang.String
readProcessID()
Read process ID.protected java.lang.String
readReproID()
Read repriotization ID.void
startReprioritization(java.lang.String processID, java.lang.String reproID)
Start a reprioritization activity.protected void
writeMinimumDepth(double depth)
Write minimum depth.protected void
writeProcessID(java.lang.String processID)
Write process ID.protected void
writeReproID(java.lang.String reproID)
Write repro ID.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
trackerWriteLock
protected static final java.lang.String trackerWriteLock
- See Also:
- Constant Field Values
-
trackerProcessIDResource
protected static final java.lang.String trackerProcessIDResource
- See Also:
- Constant Field Values
-
trackerReproIDResource
protected static final java.lang.String trackerReproIDResource
- See Also:
- Constant Field Values
-
trackerMinimumDepthResource
protected static final java.lang.String trackerMinimumDepthResource
- See Also:
- Constant Field Values
-
lockManager
protected final ILockManager lockManager
Lock manager
-
binManager
protected final IBinManager binManager
-
preloadRequests
protected final java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadRequest> preloadRequests
Preload requests
-
preloadedValues
protected final java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadedValues> preloadedValues
Preload values
-
-
Constructor Detail
-
ReprioritizationTracker
public ReprioritizationTracker(IThreadContext threadContext) throws ManifoldCFException
Constructor.- Throws:
ManifoldCFException
-
-
Method Detail
-
startReprioritization
public void startReprioritization(java.lang.String processID, java.lang.String reproID) throws ManifoldCFException
Start a reprioritization activity.- Specified by:
startReprioritization
in interfaceIReprioritizationTracker
- Parameters:
processID
- is the process ID of the process performing/waiting for the prioritization to complete.reproID
- is the reprocessing thread ID- Throws:
ManifoldCFException
-
doneReprioritization
public void doneReprioritization(java.lang.String reproID) throws ManifoldCFException
Complete a reprioritization activity. Prioritization will be marked as complete only if the processID matches the one that started the current reprioritization.- Specified by:
doneReprioritization
in interfaceIReprioritizationTracker
- Parameters:
reproID
- is the process ID of the process completing the prioritization.- Throws:
ManifoldCFException
-
isSpecifiedProcessReprioritizing
public java.lang.String isSpecifiedProcessReprioritizing(java.lang.String processID) throws ManifoldCFException
Check if the specified processID is the one performing reprioritization.- Specified by:
isSpecifiedProcessReprioritizing
in interfaceIReprioritizationTracker
- Parameters:
processID
- is the process ID to check.- Returns:
- the repro ID if the processID is confirmed to be the one.
- Throws:
ManifoldCFException
-
assessMinimumDepth
public void assessMinimumDepth(java.lang.Double[] binNamesSet) throws ManifoldCFException
Assess the current minimum depth. This method is called to provide information about the priorities of the documents being currently queued. It is the case that it is unoptimal to assign document priorities that are fundamentally higher than this value, because then the new documents will be preferentially queued, and the goal of distributing documents across bins will not be adequately met.- Specified by:
assessMinimumDepth
in interfaceIReprioritizationTracker
- Parameters:
binNamesSet
- is the current set of priorities we see on the queuing operation.- Throws:
ManifoldCFException
-
getMinimumDepth
public double getMinimumDepth() throws ManifoldCFException
Retrieve current minimum depth.- Specified by:
getMinimumDepth
in interfaceIReprioritizationTracker
- Returns:
- the current minimum depth to use.
- Throws:
ManifoldCFException
-
addPreloadRequest
public void addPreloadRequest(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth)
Note preload amounts.- Specified by:
addPreloadRequest
in interfaceIReprioritizationTracker
-
preloadBinValues
public void preloadBinValues() throws ManifoldCFException
Preload bin values. Call this OUTSIDE of a transaction.- Specified by:
preloadBinValues
in interfaceIReprioritizationTracker
- Throws:
ManifoldCFException
-
clearPreloadRequests
public void clearPreloadRequests()
Clear any preload requests.- Specified by:
clearPreloadRequests
in interfaceIReprioritizationTracker
-
clearPreloadedValues
public void clearPreloadedValues()
Clear remaining preloaded values.- Specified by:
clearPreloadedValues
in interfaceIReprioritizationTracker
-
getIncrementBinValue
public double getIncrementBinValue(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth) throws ManifoldCFException
Get a bin value.- Specified by:
getIncrementBinValue
in interfaceIReprioritizationTracker
- Parameters:
connectorClass
- is the connector class name.binName
- is the bin name.weightedMinimumDepth
- is the minimum depth to use.- Returns:
- the bin value.
- Throws:
ManifoldCFException
-
readProcessID
protected java.lang.String readProcessID() throws ManifoldCFException
Read process ID.- Returns:
- processID, or null if none.
- Throws:
ManifoldCFException
-
writeProcessID
protected void writeProcessID(java.lang.String processID) throws ManifoldCFException
Write process ID.- Parameters:
processID
- is the process ID to write.- Throws:
ManifoldCFException
-
readReproID
protected java.lang.String readReproID() throws ManifoldCFException
Read repriotization ID.- Returns:
- reproID, or null if none.
- Throws:
ManifoldCFException
-
writeReproID
protected void writeReproID(java.lang.String reproID) throws ManifoldCFException
Write repro ID.- Parameters:
reproID
- is the repro ID to write.- Throws:
ManifoldCFException
-
readMinimumDepth
protected double readMinimumDepth() throws ManifoldCFException
Read minimum depth.- Returns:
- the minimum depth.
- Throws:
ManifoldCFException
-
writeMinimumDepth
protected void writeMinimumDepth(double depth) throws ManifoldCFException
Write minimum depth.- Parameters:
depth
- the minimum depth.- Throws:
ManifoldCFException
-
-