From 4d964e627a8551dcb96a76aa794d90adf4712516 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 30 Nov 2021 16:12:16 -0500 Subject: [PATCH] 8202 address review comments --- .../autopsy/ingest/IngestJobExecutor.java | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java index 9eeb220cc2..78f7238df4 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java @@ -541,7 +541,7 @@ final class IngestJobExecutor { } /** - * Determnines which ingets job stage to start in and starts up the ingest + * Determnines which ingest job stage to start in and starts up the ingest * module pipelines. * * @return A collection of ingest module startup errors, empty on success. @@ -676,14 +676,23 @@ final class IngestJobExecutor { if (hasFileIngestModules()) { /* - * Do a count of the files the data source processor has added - * to the case database. This number will be used to estimate - * how many files remain to be analyzed as each file ingest task - * is completed. + * Do an estimate of the total number of files to be analyzed. + * This number will be used to estimate of how many files remain + * to be analyzed as each file ingest task is completed. The + * numbers are estimates because file analysis can add carved + * files and/or derived files. */ if (files.isEmpty()) { + /* + * Do a count of the files the data source processor has + * added to the case database. + */ estimatedFilesToProcess = dataSource.accept(new GetFilesCountVisitor()); } else { + /* + * Use the number of files in the specified subset of all of + * the files for the data source. + */ estimatedFilesToProcess = files.size(); } startFileIngestProgressBar(); @@ -794,11 +803,7 @@ final class IngestJobExecutor { /* * For ingest job progress reporting purposes, do a count of the * files the data source processor has added to the case - * database. This number will be used to estimate how many files - * remain to be analyzed as each file ingest task is completed. - * The estimate will likely be an over-estimate, since some of - * the files will have already been "streamed" to this job and - * processed. + * database. */ estimatedFilesToProcess = dataSource.accept(new GetFilesCountVisitor()); switchFileIngestProgressBarToDeterminate(); @@ -1204,6 +1209,7 @@ final class IngestJobExecutor { void addFiles(List files) { if (stage.equals(IngestJobStage.STREAMED_FILE_ANALYSIS_ONLY) || stage.equals(IngestJobStage.FILE_AND_HIGH_PRIORITY_DATA_SRC_LEVEL_ANALYSIS)) { + estimatedFilesToProcess += files.size(); taskScheduler.fastTrackFileIngestTasks(this, files); } else { logErrorMessage(Level.SEVERE, "Adding streaming files to job during stage " + stage.toString() + " not supported"); @@ -1362,19 +1368,17 @@ final class IngestJobExecutor { /** * Updates the current file ingest progress bar upon start of analysis of a - * file, if the job has not been cancelled, if the job has not been - * cancelled. + * file, if the job has not been cancelled. * * @param fileName The name of the file. */ private void updateFileIngestProgressForFileTaskStarted(String fileName) { if (usingNetBeansGUI && !jobCancelled) { SwingUtilities.invokeLater(() -> { - if (processedFiles <= estimatedFilesToProcess) { - fileIngestProgressBar.progress(fileName, (int) processedFiles); - } else { - fileIngestProgressBar.progress(fileName, (int) estimatedFilesToProcess); - } + /* + * Note that if processedFiles exceeds estimatedFilesToProcess + */ + fileIngestProgressBar.progress(fileName, (int) processedFiles); filesInProgress.add(fileName); }); }