From c6580d4a122ca7c7550db39061f38c96c21558d9 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 13:39:03 -0400 Subject: [PATCH 1/2] Revert "Ingest progress snapshot fix for file ingest modules" This reverts commit 39822f151d8e708ae6e810922795415d3601a9a7. --- .../autopsy/ingest/IngestManager.java | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index ed3aa833ce..3576da6c71 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -770,29 +770,45 @@ public class IngestManager implements IngestProgressSnapshotProvider { /** * Updates the ingest progress snapshot when a new ingest module starts - * working on an ingest task. + * working on a data source level ingest task. * - * @param task The ingest task. + * @param task The data source ingest task. * @param currentModuleName The display name of the currently processing * module. */ - void setIngestTaskProgress(IngestTask task, String currentModuleName) { + void setIngestTaskProgress(DataSourceIngestTask task, String currentModuleName) { + IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); + IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); + ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); + + /* + * Update the total run time for the PREVIOUS ingest module in teh + * pipeline, which has now finished its processing for the task. + */ + incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); + } + + /** + * Updates the ingest progress snapshot when a new ingest module starts + * working on a file ingest task. + * + * @param task The file ingest task. + * @param currentModuleName The display name of the currently processing + * module. + */ + void setIngestTaskProgress(FileIngestTask task, String currentModuleName) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap; - if (task instanceof FileIngestTask) { - try { - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), ((FileIngestTask)task).getFile()); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); - } - } else { + try { + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), task.getFile()); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); } ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in the + * Update the total run time for the PREVIOUS ingest module in teh * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); @@ -803,8 +819,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { * * @param task The ingest task. */ - void setIngestTaskProgressCompleted(IngestTask task - ) { + void setIngestTaskProgressCompleted(IngestTask task) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId()); ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); From fc920120b2af055d401fa8359d314893a9ce465d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 13:46:18 -0400 Subject: [PATCH 2/2] Ingest progress snapshot fix for file ingest modules --- Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 3576da6c71..f73960aeca 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -782,7 +782,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in teh + * Update the total run time for the PREVIOUS ingest module in the * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); @@ -808,7 +808,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in teh + * Update the total run time for the PREVIOUS ingest module in the * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime());