ss: add a wrapper for the state system delete files
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / statesystem / TmfStateSystemAnalysisModule.java
CommitLineData
8a6ff07f 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2013, 2015 École Polytechnique de Montréal
8a6ff07f
GB
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
baa96b1d 11 * Bernd Hufmann - Integrated history builder functionality
8a6ff07f
GB
12 *******************************************************************************/
13
2bdf0193 14package org.eclipse.tracecompass.tmf.core.statesystem;
8a6ff07f
GB
15
16import java.io.File;
baa96b1d 17import java.io.IOException;
5237a931 18import java.util.Collections;
ef06db91 19import java.util.Map;
09ec275e 20import java.util.concurrent.CountDownLatch;
8a6ff07f 21
ef06db91 22import org.apache.commons.io.FileUtils;
8a6ff07f 23import org.eclipse.core.runtime.IProgressMonitor;
e1c415b3 24import org.eclipse.core.runtime.IStatus;
baa96b1d 25import org.eclipse.core.runtime.NullProgressMonitor;
ef06db91 26import org.eclipse.jdt.annotation.NonNull;
baa96b1d 27import org.eclipse.jdt.annotation.Nullable;
ef06db91 28import org.eclipse.tracecompass.common.core.NonNullUtils;
2bdf0193
AM
29import org.eclipse.tracecompass.internal.tmf.core.statesystem.backends.partial.PartialHistoryBackend;
30import org.eclipse.tracecompass.internal.tmf.core.statesystem.backends.partial.PartialStateSystem;
e894a508
AM
31import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
32import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
33import org.eclipse.tracecompass.statesystem.core.StateSystemFactory;
34import org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend;
0306a843 35import org.eclipse.tracecompass.statesystem.core.backend.StateHistoryBackendFactory;
2bdf0193
AM
36import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
37import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
38import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
39import org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest;
40import org.eclipse.tracecompass.tmf.core.request.TmfEventRequest;
de83d1ab
MAL
41import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
42import org.eclipse.tracecompass.tmf.core.signal.TmfTraceRangeUpdatedSignal;
2bdf0193
AM
43import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
44import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
de83d1ab 45import org.eclipse.tracecompass.tmf.core.trace.ITmfTraceCompleteness;
2bdf0193 46import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
b8585c7c 47import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
5c5fa260 48import org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment;
8a6ff07f
GB
49
50/**
51 * Abstract analysis module to generate a state system. It is a base class that
52 * can be used as a shortcut by analysis who just need to build a single state
53 * system with a state provider.
54 *
55 * Analysis implementing this class should only need to provide a state system
56 * and optionally a backend (default to NULL) and, if required, a filename
57 * (defaults to the analysis'ID)
58 *
59 * @author Geneviève Bastien
8a6ff07f
GB
60 */
61public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisModule
a01f6266 62 implements ITmfAnalysisModuleWithStateSystems {
8a6ff07f 63
8a6ff07f
GB
64 private static final String EXTENSION = ".ht"; //$NON-NLS-1$
65
09ec275e 66 private final CountDownLatch fInitialized = new CountDownLatch(1);
de83d1ab 67 private final Object fRequestSyncObj = new Object();
09ec275e 68
91dc8d51 69 private @Nullable ITmfStateSystemBuilder fStateSystem;
91dc8d51
GB
70 private @Nullable ITmfEventRequest fRequest;
71 private @Nullable TmfTimeRange fTimeRange = null;
de83d1ab
MAL
72
73 private int fNbRead = 0;
c81ffdf2 74 private boolean fInitializationSucceeded;
5237a931 75
91dc8d51
GB
76 private volatile @Nullable ITmfStateProvider fStateProvider;
77
8a6ff07f
GB
78 /**
79 * State system backend types
80 *
81 * @author Geneviève Bastien
82 */
83 protected enum StateSystemBackendType {
84 /** Full history in file */
85 FULL,
86 /** In memory state system */
87 INMEM,
88 /** Null history */
89 NULL,
90 /** State system backed with partial history */
91 PARTIAL
92 }
93
72221aa4
AM
94 /**
95 * Retrieve a state system belonging to trace, by passing the ID of the
96 * relevant analysis module.
97 *
98 * This will start the execution of the analysis module, and start the
99 * construction of the state system, if needed.
100 *
101 * @param trace
102 * The trace for which you want the state system
103 * @param moduleId
104 * The ID of the state system analysis module
c81ffdf2
JCK
105 * @return The state system, or null if there was no match or the module was
106 * not initialized correctly
72221aa4
AM
107 */
108 public static @Nullable ITmfStateSystem getStateSystem(ITmfTrace trace, String moduleId) {
109 TmfStateSystemAnalysisModule module =
b8585c7c 110 TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStateSystemAnalysisModule.class, moduleId);
72221aa4 111 if (module != null) {
e8e09aa3
GB
112 ITmfStateSystem ss = module.getStateSystem();
113 if (ss != null) {
114 return ss;
115 }
e1c415b3
BH
116 IStatus status = module.schedule();
117 if (status.isOK()) {
c81ffdf2 118 return module.waitForInitialization() ? module.getStateSystem() : null;
e1c415b3 119 }
72221aa4
AM
120 }
121 return null;
122 }
123
8a6ff07f
GB
124 /**
125 * Get the state provider for this analysis module
126 *
127 * @return the state provider
128 */
8a6ff07f
GB
129 protected abstract ITmfStateProvider createStateProvider();
130
131 /**
132 * Get the state system backend type used by this module
133 *
134 * @return The {@link StateSystemBackendType}
135 */
a3b864c0
AM
136 protected StateSystemBackendType getBackendType() {
137 /* Using full history by default, sub-classes can override */
138 return StateSystemBackendType.FULL;
139 }
8a6ff07f
GB
140
141 /**
142 * Get the supplementary file name where to save this state system. The
143 * default is the ID of the analysis followed by the extension.
144 *
145 * @return The supplementary file name
146 */
147 protected String getSsFileName() {
148 return getId() + EXTENSION;
149 }
150
151 /**
baa96b1d
BH
152 * Get the state system generated by this analysis, or null if it is not yet
153 * created.
8a6ff07f
GB
154 *
155 * @return The state system
156 */
baa96b1d 157 @Nullable
8a6ff07f
GB
158 public ITmfStateSystem getStateSystem() {
159 return fStateSystem;
160 }
161
c81ffdf2
JCK
162 /**
163 * @since 2.0
164 */
6537ccdd 165 @Override
c81ffdf2 166 public boolean waitForInitialization() {
09ec275e
AM
167 try {
168 fInitialized.await();
c81ffdf2
JCK
169 } catch (InterruptedException e) {
170 return false;
171 }
172 return fInitializationSucceeded;
09ec275e
AM
173 }
174
91dc8d51
GB
175 /**
176 * @since 2.0
177 */
178 @Override
179 public boolean isQueryable(long ts) {
180 /* Return true if there is no state provider available (the analysis is not being built) */
181 ITmfStateProvider provider = fStateProvider;
182 if (provider == null) {
183 return true;
184 }
185 return ts <= provider.getLatestSafeTime();
186 }
187
baa96b1d
BH
188 // ------------------------------------------------------------------------
189 // TmfAbstractAnalysisModule
190 // ------------------------------------------------------------------------
8a6ff07f 191
ef06db91
GB
192 private @Nullable File getSsFile() {
193 ITmfTrace trace = getTrace();
194 if (trace == null) {
195 return null;
196 }
197 String directory = TmfTraceManager.getSupplementaryFileDir(trace);
198 File htFile = new File(directory + getSsFileName());
199 return htFile;
200 }
201
baa96b1d
BH
202 @Override
203 protected boolean executeAnalysis(@Nullable final IProgressMonitor monitor) {
204 IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor);
205 final ITmfStateProvider provider = createStateProvider();
8a6ff07f 206
84a9548a 207 String id = getId();
84a9548a 208
8a6ff07f
GB
209 /* FIXME: State systems should make use of the monitor, to be cancelled */
210 try {
211 /* Get the state system according to backend */
212 StateSystemBackendType backend = getBackendType();
ef06db91 213
e1c415b3
BH
214 ITmfTrace trace = getTrace();
215 if (trace == null) {
216 // Analysis was cancelled in the meantime
fa6e7869 217 analysisReady(false);
e1c415b3
BH
218 return false;
219 }
8a6ff07f 220 switch (backend) {
ef06db91
GB
221 case FULL: {
222 File htFile = getSsFile();
223 if (htFile == null) {
224 return false;
225 }
84a9548a 226 createFullHistory(id, provider, htFile);
ef06db91 227 }
8a6ff07f 228 break;
ef06db91
GB
229 case PARTIAL: {
230 File htFile = getSsFile();
231 if (htFile == null) {
232 return false;
233 }
84a9548a 234 createPartialHistory(id, provider, htFile);
ef06db91 235 }
8a6ff07f
GB
236 break;
237 case INMEM:
84a9548a 238 createInMemoryHistory(id, provider);
8a6ff07f
GB
239 break;
240 case NULL:
84a9548a 241 createNullHistory(id, provider);
8a6ff07f
GB
242 break;
243 default:
244 break;
245 }
246 } catch (TmfTraceException e) {
fa6e7869 247 analysisReady(false);
8a6ff07f
GB
248 return false;
249 }
baa96b1d 250 return !mon.isCanceled();
8a6ff07f
GB
251 }
252
fa6e7869
JCK
253 /**
254 * Make the module available and set whether the initialization succeeded or
255 * not. If not, no state system is available and
256 * {@link #waitForInitialization()} should return false.
257 *
258 * @param success
259 * True if the initialization succeeded, false otherwise
260 */
261 private void analysisReady(boolean succeeded) {
262 fInitializationSucceeded = succeeded;
263 fInitialized.countDown();
264 }
265
8a6ff07f
GB
266 @Override
267 protected void canceling() {
baa96b1d
BH
268 ITmfEventRequest req = fRequest;
269 if ((req != null) && (!req.isCompleted())) {
270 req.cancel();
271 }
272 }
273
a1529f38
AM
274 @Override
275 public void dispose() {
130e6f4e 276 super.dispose();
a1529f38
AM
277 if (fStateSystem != null) {
278 fStateSystem.dispose();
279 }
a1529f38
AM
280 }
281
baa96b1d
BH
282 // ------------------------------------------------------------------------
283 // History creation methods
284 // ------------------------------------------------------------------------
285
286 /*
287 * Load the history file matching the target trace. If the file already
288 * exists, it will be opened directly. If not, it will be created from
289 * scratch.
290 */
84a9548a 291 private void createFullHistory(String id, ITmfStateProvider provider, File htFile) throws TmfTraceException {
baa96b1d
BH
292
293 /* If the target file already exists, do not rebuild it uselessly */
294 // TODO for now we assume it's complete. Might be a good idea to check
295 // at least if its range matches the trace's range.
296
297 if (htFile.exists()) {
298 /* Load an existing history */
299 final int version = provider.getVersion();
300 try {
0306a843
AM
301 IStateHistoryBackend backend = StateHistoryBackendFactory.createHistoryTreeBackendExistingFile(
302 id, htFile, version);
b2f62cb5 303 fStateSystem = StateSystemFactory.newStateSystem(backend, false);
fa6e7869 304 analysisReady(true);
baa96b1d
BH
305 return;
306 } catch (IOException e) {
307 /*
308 * There was an error opening the existing file. Perhaps it was
309 * corrupted, perhaps it's an old version? We'll just
310 * fall-through and try to build a new one from scratch instead.
311 */
312 }
313 }
314
315 /* Size of the blocking queue to use when building a state history */
4cdea8fc 316 final int QUEUE_SIZE = 10000;
baa96b1d
BH
317
318 try {
0306a843 319 IStateHistoryBackend backend = StateHistoryBackendFactory.createHistoryTreeBackendNewFile(
f6d24a71 320 id, htFile, provider.getVersion(), provider.getStartTime(), QUEUE_SIZE);
b2f62cb5 321 fStateSystem = StateSystemFactory.newStateSystem(backend);
baa96b1d
BH
322 provider.assignTargetStateSystem(fStateSystem);
323 build(provider);
324 } catch (IOException e) {
325 /*
326 * If it fails here however, it means there was a problem writing to
327 * the disk, so throw a real exception this time.
328 */
329 throw new TmfTraceException(e.toString(), e);
330 }
331 }
332
333 /*
334 * Create a new state system backed with a partial history. A partial
335 * history is similar to a "full" one (which you get with
336 * {@link #newFullHistory}), except that the file on disk is much smaller,
337 * but queries are a bit slower.
338 *
339 * Also note that single-queries are implemented using a full-query
340 * underneath, (which are much slower), so this might not be a good fit for
341 * a use case where you have to do lots of single queries.
342 */
84a9548a 343 private void createPartialHistory(String id, ITmfStateProvider provider, File htPartialFile)
baa96b1d
BH
344 throws TmfTraceException {
345 /*
346 * The order of initializations is very tricky (but very important!)
347 * here. We need to follow this pattern:
348 * (1 is done before the call to this method)
349 *
350 * 1- Instantiate realStateProvider
351 * 2- Instantiate realBackend
352 * 3- Instantiate partialBackend, with prereqs:
353 * 3a- Instantiate partialProvider, via realProvider.getNew()
354 * 3b- Instantiate nullBackend (partialSS's backend)
355 * 3c- Instantiate partialSS
356 * 3d- partialProvider.assignSS(partialSS)
357 * 4- Instantiate realSS
358 * 5- partialSS.assignUpstream(realSS)
359 * 6- realProvider.assignSS(realSS)
360 * 7- Call HistoryBuilder(realProvider, realSS, partialBackend) to build the thing.
361 */
362
363 /* Size of the blocking queue to use when building a state history */
364 final int QUEUE_SIZE = 10000;
365
366 final long granularity = 50000;
367
368 /* 2 */
369 IStateHistoryBackend realBackend = null;
370 try {
0306a843 371 realBackend = StateHistoryBackendFactory.createHistoryTreeBackendNewFile(
f6d24a71 372 id, htPartialFile, provider.getVersion(), provider.getStartTime(), QUEUE_SIZE);
baa96b1d
BH
373 } catch (IOException e) {
374 throw new TmfTraceException(e.toString(), e);
375 }
376
377 /* 3a */
378 ITmfStateProvider partialProvider = provider.getNewInstance();
379
380 /* 3b-3c, constructor automatically uses a NullBackend */
381 PartialStateSystem pss = new PartialStateSystem();
382
383 /* 3d */
384 partialProvider.assignTargetStateSystem(pss);
385
386 /* 3 */
651cbda0 387 IStateHistoryBackend partialBackend = new PartialHistoryBackend(id + ".partial", partialProvider, pss, realBackend, granularity); //$NON-NLS-1$
baa96b1d
BH
388
389 /* 4 */
bcec0116 390 @SuppressWarnings("restriction")
e894a508 391 org.eclipse.tracecompass.internal.statesystem.core.StateSystem realSS =
b2f62cb5 392 (org.eclipse.tracecompass.internal.statesystem.core.StateSystem) StateSystemFactory.newStateSystem(partialBackend);
baa96b1d
BH
393
394 /* 5 */
395 pss.assignUpstream(realSS);
396
397 /* 6 */
398 provider.assignTargetStateSystem(realSS);
399
400 /* 7 */
baa96b1d
BH
401 fStateSystem = realSS;
402
403 build(provider);
404 }
405
406 /*
407 * Create a new state system using a null history back-end. This means that
408 * no history intervals will be saved anywhere, and as such only
409 * {@link ITmfStateSystem#queryOngoingState} will be available.
410 */
84a9548a 411 private void createNullHistory(String id, ITmfStateProvider provider) {
0306a843 412 IStateHistoryBackend backend = StateHistoryBackendFactory.createNullBackend(id);
b2f62cb5 413 fStateSystem = StateSystemFactory.newStateSystem(backend);
baa96b1d
BH
414 provider.assignTargetStateSystem(fStateSystem);
415 build(provider);
416 }
417
418 /*
419 * Create a new state system using in-memory interval storage. This should
420 * only be done for very small state system, and will be naturally limited
421 * to 2^31 intervals.
422 */
84a9548a 423 private void createInMemoryHistory(String id, ITmfStateProvider provider) {
0306a843 424 IStateHistoryBackend backend = StateHistoryBackendFactory.createInMemoryBackend(id, provider.getStartTime());
b2f62cb5 425 fStateSystem = StateSystemFactory.newStateSystem(backend);
baa96b1d
BH
426 provider.assignTargetStateSystem(fStateSystem);
427 build(provider);
428 }
429
a1529f38 430 private void disposeProvider(boolean deleteFiles) {
baa96b1d
BH
431 ITmfStateProvider provider = fStateProvider;
432 if (provider != null) {
433 provider.dispose();
434 }
91dc8d51 435 fStateProvider = null;
d4792e92
MK
436 if (deleteFiles && (fStateSystem != null)) {
437 fStateSystem.removeFiles();
baa96b1d
BH
438 }
439 }
440
441 private void build(ITmfStateProvider provider) {
d4792e92 442 if (fStateSystem == null) {
baa96b1d
BH
443 throw new IllegalArgumentException();
444 }
445
446 ITmfEventRequest request = fRequest;
447 if ((request != null) && (!request.isCompleted())) {
448 request.cancel();
449 }
450
de83d1ab
MAL
451 fTimeRange = TmfTimeRange.ETERNITY;
452 final ITmfTrace trace = provider.getTrace();
d0c7e4ba 453 if (!isCompleteTrace(trace)) {
6cfc180e 454 fTimeRange = trace.getTimeRange();
de83d1ab 455 }
baa96b1d 456
baa96b1d 457 fStateProvider = provider;
de83d1ab
MAL
458 synchronized (fRequestSyncObj) {
459 startRequest();
460 }
baa96b1d 461
09ec275e
AM
462 /*
463 * The state system object is now created, we can consider this module
464 * "initialized" (components can retrieve it and start doing queries).
465 */
fa6e7869 466 analysisReady(true);
09ec275e
AM
467
468 /*
469 * Block the executeAnalysis() construction is complete (so that the
470 * progress monitor displays that it is running).
471 */
baa96b1d 472 try {
de83d1ab
MAL
473 if (fRequest != null) {
474 fRequest.waitForCompletion();
475 }
baa96b1d
BH
476 } catch (InterruptedException e) {
477 e.printStackTrace();
478 }
479 }
480
481 private class StateSystemEventRequest extends TmfEventRequest {
482 private final ITmfStateProvider sci;
483 private final ITmfTrace trace;
484
de83d1ab 485 public StateSystemEventRequest(ITmfStateProvider sp, TmfTimeRange timeRange, int index) {
e2bcc8a5 486 super(ITmfEvent.class,
de83d1ab
MAL
487 timeRange,
488 index,
baa96b1d 489 ITmfEventRequest.ALL_DATA,
09f15ee9
GB
490 ITmfEventRequest.ExecutionType.BACKGROUND,
491 TmfStateSystemAnalysisModule.this.getDependencyLevel());
baa96b1d 492 this.sci = sp;
0e4f957e 493 trace = sci.getTrace();
baa96b1d 494
baa96b1d
BH
495 }
496
497 @Override
41f3b36b 498 public void handleData(final ITmfEvent event) {
baa96b1d 499 super.handleData(event);
41f3b36b 500 if (event.getTrace() == trace) {
baa96b1d 501 sci.processEvent(event);
2d208fb7
GB
502 } else if (trace instanceof TmfExperiment) {
503 /*
504 * If the request is for an experiment, check if the event is
505 * from one of the child trace
506 */
507 for (ITmfTrace childTrace : ((TmfExperiment) trace).getTraces()) {
508 if (childTrace == event.getTrace()) {
509 sci.processEvent(event);
510 }
511 }
baa96b1d
BH
512 }
513 }
514
515 @Override
516 public void handleSuccess() {
517 super.handleSuccess();
de83d1ab
MAL
518 if (isCompleteTrace(trace)) {
519 disposeProvider(false);
520 } else {
521 fNbRead += getNbRead();
522 synchronized (fRequestSyncObj) {
523 final TmfTimeRange timeRange = fTimeRange;
524 if (timeRange != null) {
525 if (getRange().getEndTime().getValue() < timeRange.getEndTime().getValue()) {
526 startRequest();
527 }
528 }
529 }
530 }
baa96b1d
BH
531 }
532
533 @Override
534 public void handleCancel() {
535 super.handleCancel();
91dc8d51 536 disposeProvider(true);
baa96b1d
BH
537 }
538
539 @Override
540 public void handleFailure() {
541 super.handleFailure();
a1529f38 542 disposeProvider(true);
baa96b1d 543 }
8a6ff07f
GB
544 }
545
5237a931
AM
546 // ------------------------------------------------------------------------
547 // ITmfAnalysisModuleWithStateSystems
548 // ------------------------------------------------------------------------
549
550 @Override
baa96b1d
BH
551 @Nullable
552 public ITmfStateSystem getStateSystem(String id) {
5237a931
AM
553 if (id.equals(getId())) {
554 return fStateSystem;
555 }
556 return null;
557 }
558
8a6ff07f 559 @Override
11b771eb 560 public @NonNull Iterable<@NonNull ITmfStateSystem> getStateSystems() {
aa353506
AM
561 ITmfStateSystemBuilder stateSystem = fStateSystem;
562 if (stateSystem == null) {
563 return Collections.EMPTY_SET;
564 }
565 return Collections.singleton(stateSystem);
8a6ff07f 566 }
de83d1ab
MAL
567
568 /**
569 * Signal handler for the TmfTraceRangeUpdatedSignal signal
570 *
571 * @param signal The incoming signal
572 */
573 @TmfSignalHandler
574 public void traceRangeUpdated(final TmfTraceRangeUpdatedSignal signal) {
575 fTimeRange = signal.getRange();
576 ITmfStateProvider stateProvider = fStateProvider;
577 synchronized (fRequestSyncObj) {
578 if (signal.getTrace() == getTrace() && stateProvider != null && stateProvider.getAssignedStateSystem() != null) {
579 ITmfEventRequest request = fRequest;
580 if ((request == null) || request.isCompleted()) {
581 startRequest();
582 }
583 }
584 }
585 }
586
587 private void startRequest() {
588 ITmfStateProvider stateProvider = fStateProvider;
589 TmfTimeRange timeRange = fTimeRange;
590 if (stateProvider == null || timeRange == null) {
591 return;
592 }
593 ITmfEventRequest request = new StateSystemEventRequest(stateProvider, timeRange, fNbRead);
594 stateProvider.getTrace().sendRequest(request);
595 fRequest = request;
596 }
597
598 private static boolean isCompleteTrace(ITmfTrace trace) {
599 return !(trace instanceof ITmfTraceCompleteness) || ((ITmfTraceCompleteness) trace).isComplete();
600 }
ef06db91
GB
601
602 // ------------------------------------------------------------------------
603 // ITmfPropertiesProvider
604 // ------------------------------------------------------------------------
605
606 /**
607 * @since 2.0
608 */
609 @Override
610 public @NonNull Map<@NonNull String, @NonNull String> getProperties() {
a01f6266 611 Map<@NonNull String, @NonNull String> properties = super.getProperties();
ef06db91
GB
612
613 StateSystemBackendType backend = getBackendType();
0e4f957e 614 properties.put(NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesBackend), backend.name());
ef06db91
GB
615 switch (backend) {
616 case FULL:
617 case PARTIAL:
618 File htFile = getSsFile();
619 if (htFile != null) {
620 if (htFile.exists()) {
621 properties.put(NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesFileSize), FileUtils.byteCountToDisplaySize(htFile.length()));
622 } else {
623 properties.put(NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesFileSize), NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesAnalysisNotExecuted));
624 }
625 }
626 break;
627 case INMEM:
628 case NULL:
629 default:
630 break;
631
632 }
633 return properties;
634 }
8a6ff07f 635}
This page took 0.110865 seconds and 5 git commands to generate.