7529 no error msg for ignored tasks

This commit is contained in:
Richard Cordovano 2021-12-08 10:07:15 -05:00
parent 2fbd61fa38
commit 3edb33b8f3

View File

@ -117,7 +117,7 @@ final class IngestJobExecutor {
private AnalysisResultIngestPipeline analysisResultIngestPipeline; private AnalysisResultIngestPipeline analysisResultIngestPipeline;
/* /*
* An ingest job transistion through several states during its execution. * An ingest job transistions through several states during its execution.
*/ */
private static enum IngestJobState { private static enum IngestJobState {
/* /*
@ -1357,10 +1357,29 @@ final class IngestJobExecutor {
*/ */
void addAnalysisResults(List<AnalysisResult> results) { void addAnalysisResults(List<AnalysisResult> results) {
if (!isCancelled() && hasAnalysisResultIngestModules()) { if (!isCancelled() && hasAnalysisResultIngestModules()) {
if (jobState.equals(IngestJobState.STREAMED_FILE_ANALYSIS_ONLY) || jobState.equals(IngestJobState.FILE_AND_HIGH_PRIORITY_DATA_SRC_LEVEL_ANALYSIS) || jobState.equals(IngestJobState.LOW_PRIORITY_DATA_SRC_LEVEL_ANALYSIS)) { switch (jobState) {
taskScheduler.scheduleAnalysisResultIngestTasks(this, results); case STREAMED_FILE_ANALYSIS_ONLY:
} else { case FILE_AND_HIGH_PRIORITY_DATA_SRC_LEVEL_ANALYSIS:
logErrorMessage(Level.SEVERE, "Attempt to add analysis results to job during stage " + jobState.toString() + " not supported"); case LOW_PRIORITY_DATA_SRC_LEVEL_ANALYSIS:
taskScheduler.scheduleAnalysisResultIngestTasks(this, results);
break;
case PIPELINES_SHUTTING_DOWN:
/*
* Don't log an error if there is an attempt to add an
* analysis result ingest task in a pipeline shut down
* state. This is a work around for dealing with analysis
* results generated by a final keyword search carried out
* during ingest module shut down by simply ignoring them.
* Other ideas were to add a startShutDown() phase to the
* ingest module life cycle (complicated), or to add a flag
* to keyword hit processing to suppress posting the keyword
* hit analysis results to the blackboard during a final
* search (API changes required to allow firing of the event
* to make any GUI refresh).
*/
break;
default:
logErrorMessage(Level.SEVERE, "Attempt to add analysis results to job during stage " + jobState.toString() + " not supported");
} }
} }
} }