Class 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • 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 queue
      protected int lowestStuffAmt
      This is the lowest number of entries we want ot stuff at any one time
      protected int lowWaterMark
      This is the low water mark for attempting to restuff
      protected java.lang.String processID
      Process ID
      protected QueueTracker queueTracker
      This is the queue tracker object.
      protected WorkerResetManager resetManager
      Worker thread pool reset manager
      protected 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
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • 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