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 classReprioritizationTracker.PreloadedValuesA set of preloaded valuesprotected static classReprioritizationTracker.PreloadKeyConnector class name, bin name pairprotected static classReprioritizationTracker.PreloadRequestA preload request
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected IBinManagerbinManagerprotected ILockManagerlockManagerLock managerprotected java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadedValues>preloadedValuesPreload valuesprotected java.util.Map<ReprioritizationTracker.PreloadKey,ReprioritizationTracker.PreloadRequest>preloadRequestsPreload requestsprotected static java.lang.StringtrackerMinimumDepthResourceprotected static java.lang.StringtrackerProcessIDResourceprotected static java.lang.StringtrackerReproIDResourceprotected static java.lang.StringtrackerWriteLock
-
Constructor Summary
Constructors Constructor Description ReprioritizationTracker(IThreadContext threadContext)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPreloadRequest(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth)Note preload amounts.voidassessMinimumDepth(java.lang.Double[] binNamesSet)Assess the current minimum depth.voidclearPreloadedValues()Clear remaining preloaded values.voidclearPreloadRequests()Clear any preload requests.voiddoneReprioritization(java.lang.String reproID)Complete a reprioritization activity.doublegetIncrementBinValue(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth)Get a bin value.doublegetMinimumDepth()Retrieve current minimum depth.java.lang.StringisSpecifiedProcessReprioritizing(java.lang.String processID)Check if the specified processID is the one performing reprioritization.voidpreloadBinValues()Preload bin values.protected doublereadMinimumDepth()Read minimum depth.protected java.lang.StringreadProcessID()Read process ID.protected java.lang.StringreadReproID()Read repriotization ID.voidstartReprioritization(java.lang.String processID, java.lang.String reproID)Start a reprioritization activity.protected voidwriteMinimumDepth(double depth)Write minimum depth.protected voidwriteProcessID(java.lang.String processID)Write process ID.protected voidwriteReproID(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 ManifoldCFExceptionStart a reprioritization activity.- Specified by:
startReprioritizationin 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 ManifoldCFExceptionComplete a reprioritization activity. Prioritization will be marked as complete only if the processID matches the one that started the current reprioritization.- Specified by:
doneReprioritizationin 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 ManifoldCFExceptionCheck if the specified processID is the one performing reprioritization.- Specified by:
isSpecifiedProcessReprioritizingin 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 ManifoldCFExceptionAssess 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:
assessMinimumDepthin interfaceIReprioritizationTracker- Parameters:
binNamesSet- is the current set of priorities we see on the queuing operation.- Throws:
ManifoldCFException
-
getMinimumDepth
public double getMinimumDepth() throws ManifoldCFExceptionRetrieve current minimum depth.- Specified by:
getMinimumDepthin 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:
addPreloadRequestin interfaceIReprioritizationTracker
-
preloadBinValues
public void preloadBinValues() throws ManifoldCFExceptionPreload bin values. Call this OUTSIDE of a transaction.- Specified by:
preloadBinValuesin interfaceIReprioritizationTracker- Throws:
ManifoldCFException
-
clearPreloadRequests
public void clearPreloadRequests()
Clear any preload requests.- Specified by:
clearPreloadRequestsin interfaceIReprioritizationTracker
-
clearPreloadedValues
public void clearPreloadedValues()
Clear remaining preloaded values.- Specified by:
clearPreloadedValuesin interfaceIReprioritizationTracker
-
getIncrementBinValue
public double getIncrementBinValue(java.lang.String connectorClass, java.lang.String binName, double weightedMinimumDepth) throws ManifoldCFExceptionGet a bin value.- Specified by:
getIncrementBinValuein 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 ManifoldCFExceptionRead process ID.- Returns:
- processID, or null if none.
- Throws:
ManifoldCFException
-
writeProcessID
protected void writeProcessID(java.lang.String processID) throws ManifoldCFExceptionWrite process ID.- Parameters:
processID- is the process ID to write.- Throws:
ManifoldCFException
-
readReproID
protected java.lang.String readReproID() throws ManifoldCFExceptionRead repriotization ID.- Returns:
- reproID, or null if none.
- Throws:
ManifoldCFException
-
writeReproID
protected void writeReproID(java.lang.String reproID) throws ManifoldCFExceptionWrite repro ID.- Parameters:
reproID- is the repro ID to write.- Throws:
ManifoldCFException
-
readMinimumDepth
protected double readMinimumDepth() throws ManifoldCFExceptionRead minimum depth.- Returns:
- the minimum depth.
- Throws:
ManifoldCFException
-
writeMinimumDepth
protected void writeMinimumDepth(double depth) throws ManifoldCFExceptionWrite minimum depth.- Parameters:
depth- the minimum depth.- Throws:
ManifoldCFException
-
-