Package org.apache.tika.batch
Class StatusReporter
- java.lang.Object
- 
- org.apache.tika.batch.StatusReporter
 
- 
- All Implemented Interfaces:
- Callable<IFileProcessorFutureResult>
 
 public class StatusReporter extends Object implements Callable<IFileProcessorFutureResult> Basic class to use for reporting status from both the crawler and the consumers. This wakes up roughly everysleepMillisand log.info's a status report.
- 
- 
Constructor SummaryConstructors Constructor Description StatusReporter(FileResourceCrawler crawler, ConsumersManager consumersManager)Initialize with the crawler and consumers
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFileProcessorFutureResultcall()Startup the reporter.intgetRoughCountExceptions()This returns a rough (unsynchronized) count of caught/handled exceptions.protected voidreport(String s)Override for different behavior.voidsetIsShuttingDown(boolean isShuttingDown)Set whether the main process is in the process of shutting down.voidsetSleepMillis(long sleepMillis)Set the amount of time to sleep between reports.voidsetStaleThresholdMillis(long staleThresholdMillis)Set the amount of time in milliseconds to use as the threshold for determining a stale parse.
 
- 
- 
- 
Constructor Detail- 
StatusReporterpublic StatusReporter(FileResourceCrawler crawler, ConsumersManager consumersManager) Initialize with the crawler and consumers- Parameters:
- crawler- crawler to ping at intervals
- consumersManager- consumers to ping at intervals
 
 
- 
 - 
Method Detail- 
reportprotected void report(String s) Override for different behavior. This reports the string at the info level to this class' logger.- Parameters:
- s- string to report
 
 - 
callpublic IFileProcessorFutureResult call() Startup the reporter.- Specified by:
- callin interface- Callable<IFileProcessorFutureResult>
 
 - 
setSleepMillispublic void setSleepMillis(long sleepMillis) Set the amount of time to sleep between reports.- Parameters:
- sleepMillis- length to sleep btwn reports in milliseconds
 
 - 
setStaleThresholdMillispublic void setStaleThresholdMillis(long staleThresholdMillis) Set the amount of time in milliseconds to use as the threshold for determining a stale parse.- Parameters:
- staleThresholdMillis- threshold for determining whether or not to report a stale
 
 - 
getRoughCountExceptionspublic int getRoughCountExceptions() This returns a rough (unsynchronized) count of caught/handled exceptions.- Returns:
- rough count of exceptions
 
 - 
setIsShuttingDownpublic void setIsShuttingDown(boolean isShuttingDown) Set whether the main process is in the process of shutting down.- Parameters:
- isShuttingDown-
 
 
- 
 
-