From dd126a7ffe965153e136fb63ecba1ac8fde85fc0 Mon Sep 17 00:00:00 2001 From: Eugene Livis Date: Wed, 13 Mar 2019 11:01:29 -0400 Subject: [PATCH] Switched to single thread --- .../casemodule/StartupWindowProvider.java | 3 +-- .../CommandLineIngestManager.java | 16 +--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java index 4b501eef99..a922a6f19d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java @@ -65,8 +65,7 @@ public class StartupWindowProvider implements StartupWindowInterface { System.out.println("Running from command line"); startupWindowToUse = new CommandLineStartupWindow(); // kick off command line processing - CommandLineIngestManager ingestManager = new CommandLineIngestManager(); - ingestManager.start(); + new CommandLineIngestManager().start(); return; } diff --git a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java index 43279e9b0c..13b76a5eca 100755 --- a/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/commandlineingest/CommandLineIngestManager.java @@ -26,13 +26,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.UUID; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.Collection; import java.util.Iterator; -import java.util.concurrent.ExecutionException; import java.util.logging.Level; import org.netbeans.spi.sendopts.OptionProcessor; import org.openide.LifecycleManager; @@ -46,7 +41,6 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback import static org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.ThreadUtils; import org.sleuthkit.autopsy.coreutils.TimeStampUtils; import org.sleuthkit.autopsy.datasourceprocessors.AutoIngestDataSourceProcessor; import org.sleuthkit.autopsy.events.AutopsyEvent; @@ -68,24 +62,16 @@ import org.sleuthkit.datamodel.Content; public class CommandLineIngestManager { private static final Logger LOGGER = Logger.getLogger(CommandLineIngestManager.class.getName()); - private static final String JOB_RUNNING_THREAD_NAME = "CIM-job-processing-%d"; - private final ExecutorService jobProcessingExecutor; - private Future jobProcessingTaskFuture; private Path rootOutputDirectory; public CommandLineIngestManager() { - jobProcessingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(JOB_RUNNING_THREAD_NAME).build()); } public void start() { - JobProcessingTask jobProcessingTask = new JobProcessingTask(); - jobProcessingTaskFuture = jobProcessingExecutor.submit(jobProcessingTask); + new Thread(new JobProcessingTask()).start(); } public void stop() { - - ThreadUtils.shutDownTaskExecutor(jobProcessingExecutor); - try { // close current case if there is one open Case.closeCurrentCase();