Class StufferThread
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.manifoldcf.crawler.system.StufferThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class StufferThread extends java.lang.Thread
This class represents the stuffer thread. This thread's job is to request documents from the database and add them to the document queue. The thread then sleeps until the document queue is empty again.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected BlockingDocuments
blockingDocuments
Blocking documents object.protected DocumentQueue
documentQueue
This is a reference to the static main document queueprotected int
lowestStuffAmt
This is the lowest number of entries we want ot stuff at any one timeprotected int
lowWaterMark
This is the low water mark for attempting to restuffprotected java.lang.String
processID
Process IDprotected QueueTracker
queueTracker
This is the queue tracker object.protected WorkerResetManager
resetManager
Worker thread pool reset managerprotected int
stuffAmt
This is the number of entries we want to stuff at any one time.protected static java.lang.String
stufferThreadLastTimeDatumName
Datum which contains the last time, in milliseconds since epoch, that any stuffer thread in the cluster successfully fired.protected static java.lang.String
stufferThreadLockName
Write lock which allows us to keep track of the last time ANY stuffer thread stuffed data
-
Constructor Summary
Constructors Constructor Description StufferThread(DocumentQueue documentQueue, int n, WorkerResetManager resetManager, QueueTracker qt, BlockingDocuments blockingDocuments, float lowWaterFactor, float stuffSizeFactor, java.lang.String processID)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static long
readLastTime(ILockManager lockManager)
void
run()
protected static void
writeLastTime(ILockManager lockManager, long lastTime)
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
stufferThreadLockName
protected static final java.lang.String stufferThreadLockName
Write lock which allows us to keep track of the last time ANY stuffer thread stuffed data- See Also:
- Constant Field Values
-
stufferThreadLastTimeDatumName
protected static final java.lang.String stufferThreadLastTimeDatumName
Datum which contains the last time, in milliseconds since epoch, that any stuffer thread in the cluster successfully fired.- See Also:
- Constant Field Values
-
documentQueue
protected final DocumentQueue documentQueue
This is a reference to the static main document queue
-
resetManager
protected final WorkerResetManager resetManager
Worker thread pool reset manager
-
lowestStuffAmt
protected final int lowestStuffAmt
This is the lowest number of entries we want ot stuff at any one time
-
stuffAmt
protected int stuffAmt
This is the number of entries we want to stuff at any one time.
-
lowWaterMark
protected final int lowWaterMark
This is the low water mark for attempting to restuff
-
queueTracker
protected final QueueTracker queueTracker
This is the queue tracker object.
-
blockingDocuments
protected final BlockingDocuments blockingDocuments
Blocking documents object.
-
processID
protected final java.lang.String processID
Process ID
-
-
Constructor Detail
-
StufferThread
public StufferThread(DocumentQueue documentQueue, int n, WorkerResetManager resetManager, QueueTracker qt, BlockingDocuments blockingDocuments, float lowWaterFactor, float stuffSizeFactor, java.lang.String processID) throws ManifoldCFException
Constructor.- Parameters:
documentQueue
- is the document queue we'll be stuffing.n
- represents the number of threads that will be processing queued stuff, NOT the number of documents to be done at once!- Throws:
ManifoldCFException
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
readLastTime
protected static long readLastTime(ILockManager lockManager) throws ManifoldCFException
- Throws:
ManifoldCFException
-
writeLastTime
protected static void writeLastTime(ILockManager lockManager, long lastTime) throws ManifoldCFException
- Throws:
ManifoldCFException
-
-