Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
IngestJobProgressSnapshot.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014-2021 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.ingest;
20 
21 import java.io.Serializable;
22 import java.util.Collections;
23 import java.util.Date;
24 import java.util.List;
25 
29 public final class IngestJobProgressSnapshot implements Serializable {
30 
31  private static final long serialVersionUID = 1L;
32 
33  private final String dataSource;
34  private final long jobId;
35  private final long jobStartTime;
36  private final long snapShotTime;
37  private final String currentIngestModuleTier;
38  transient private final DataSourceIngestPipeline.DataSourcePipelineModule dataSourceLevelIngestModule;
39  private final boolean fileIngestRunning;
40  private final Date fileIngestStartTime;
41  private final long processedFiles;
42  private final long estimatedFilesToProcess;
43  private final IngestTasksScheduler.IngestTasksSnapshot tasksSnapshot;
44  transient private final boolean jobCancelled;
46  transient private final List<String> cancelledDataSourceModules;
47 
52  String dataSourceName,
53  long jobId,
54  long jobStartTime,
55  String currentIngestModuleTier,
56  DataSourceIngestPipeline.DataSourcePipelineModule dataSourceIngestModule,
57  boolean fileIngestRunning,
58  Date fileIngestStartTime,
59  boolean jobCancelled,
60  IngestJob.CancellationReason cancellationReason,
61  List<String> cancelledModules,
62  long processedFiles,
63  long estimatedFilesToProcess,
64  long snapshotTime,
65  IngestTasksScheduler.IngestTasksSnapshot tasksSnapshot) {
66  this.dataSource = dataSourceName;
67  this.jobId = jobId;
68  this.jobStartTime = jobStartTime;
69  this.currentIngestModuleTier = currentIngestModuleTier;
70  this.dataSourceLevelIngestModule = dataSourceIngestModule;
71  this.fileIngestRunning = fileIngestRunning;
72  this.fileIngestStartTime = fileIngestStartTime;
73  this.jobCancelled = jobCancelled;
74  this.jobCancellationReason = cancellationReason;
75  this.cancelledDataSourceModules = cancelledModules;
76  this.processedFiles = processedFiles;
77  this.estimatedFilesToProcess = estimatedFilesToProcess;
78  this.snapShotTime = snapshotTime;
80  }
81 
88  long getSnapshotTime() {
89  return snapShotTime;
90  }
91 
97  String getDataSource() {
98  return dataSource;
99  }
100 
106  long getJobId() {
107  return this.jobId;
108  }
109 
116  long getJobStartTime() {
117  return jobStartTime;
118  }
119 
125  String getCurrentIngestModuleTier() {
127  }
128 
135  DataSourceIngestPipeline.DataSourcePipelineModule getDataSourceLevelIngestModule() {
136  return this.dataSourceLevelIngestModule;
137  }
138 
145  boolean getFileIngestIsRunning() {
146  return this.fileIngestRunning;
147  }
148 
154  // RJCTODO: How is this affected by ingest module tiers?
155  Date getFileIngestStartTime() {
156  return new Date(fileIngestStartTime.getTime());
157  }
158 
164  // RJCTODO: How is this affected by ingest module tiers?
165  double getFilesProcessedPerSec() {
166  return (double) processedFiles / ((snapShotTime - jobStartTime) / 1000);
167  }
168 
174  // RJCTODO: How is this affected by ingest module tiers?
175  long getFilesProcessed() {
176  return processedFiles;
177  }
178 
184  // RJCTODO: How is this affected by ingest module tiers?
185  long getFilesEstimated() {
187  }
188 
196  long getDsQueueSize() {
197  if (null == this.tasksSnapshot) {
198  return 0;
199  }
200  return this.tasksSnapshot.getDataSourceQueueSize();
201  }
202 
209  long getRootQueueSize() {
210  if (null == this.tasksSnapshot) {
211  return 0;
212  }
213  return this.tasksSnapshot.getRootQueueSize();
214  }
215 
222  long getDirQueueSize() {
223  if (null == this.tasksSnapshot) {
224  return 0;
225  }
226  return this.tasksSnapshot.getDirQueueSize();
227  }
228 
235  long getStreamingQueueSize() {
236  if (null == this.tasksSnapshot) {
237  return 0;
238  }
239  return this.tasksSnapshot.getStreamedFilesQueueSize();
240  }
241 
248  long getFileQueueSize() {
249  if (null == this.tasksSnapshot) {
250  return 0;
251  }
252  return this.tasksSnapshot.getFileQueueSize();
253  }
254 
262  long getDataArtifactTasksQueueSize() {
263  if (tasksSnapshot == null) {
264  return 0;
265  }
266  return tasksSnapshot.getArtifactsQueueSize();
267  }
268 
276  long getAnalysisResultTasksQueueSize() {
277  if (tasksSnapshot == null) {
278  return 0;
279  }
280  return tasksSnapshot.getResultsQueueSize();
281  }
282 
289  long getRunningListSize() {
290  if (null == this.tasksSnapshot) {
291  return 0;
292  }
293  return this.tasksSnapshot.getProgressListSize();
294  }
295 
301  boolean isCancelled() {
302  return this.jobCancelled;
303  }
304 
310  IngestJob.CancellationReason getCancellationReason() {
311  return this.jobCancellationReason;
312  }
313 
321  List<String> getCancelledDataSourceIngestModules() {
322  return Collections.unmodifiableList(this.cancelledDataSourceModules);
323  }
324 
325 }
transient final DataSourceIngestPipeline.DataSourcePipelineModule dataSourceLevelIngestModule
final IngestTasksScheduler.IngestTasksSnapshot tasksSnapshot
transient final IngestJob.CancellationReason jobCancellationReason

Copyright © 2012-2022 Basis Technology. Generated on: Thu Dec 8 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.