tmf : Fix get analysis modules when executing analysis in TmfTrace
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / TmfTrace.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2015 Ericsson, École Polytechnique de Montréal
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 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Updated as per TMF Trace Model 1.0
12 * Patrick Tasse - Updated for removal of context clone
13 * Geneviève Bastien - Added timestamp transforms, its saving to file and
14 * timestamp creation functions
15 *******************************************************************************/
16
17 package org.eclipse.tracecompass.tmf.core.trace;
18
19 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
20
21 import java.io.File;
22 import java.util.Collection;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.LinkedHashMap;
26 import java.util.Map;
27 import java.util.Set;
28
29 import org.eclipse.core.resources.IResource;
30 import org.eclipse.core.runtime.IStatus;
31 import org.eclipse.core.runtime.MultiStatus;
32 import org.eclipse.core.runtime.Path;
33 import org.eclipse.core.runtime.Status;
34 import org.eclipse.jdt.annotation.NonNull;
35 import org.eclipse.jdt.annotation.Nullable;
36 import org.eclipse.tracecompass.internal.tmf.core.Activator;
37 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
38 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
39 import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager;
40 import org.eclipse.tracecompass.tmf.core.component.TmfEventProvider;
41 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
42 import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
43 import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
44 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
45 import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
46 import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
47 import org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest;
48 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
49 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
50 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
51 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceRangeUpdatedSignal;
52 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceUpdatedSignal;
53 import org.eclipse.tracecompass.tmf.core.synchronization.ITmfTimestampTransform;
54 import org.eclipse.tracecompass.tmf.core.synchronization.TimestampTransformFactory;
55 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
56 import org.eclipse.tracecompass.tmf.core.timestamp.TmfNanoTimestamp;
57 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
58 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
59 import org.eclipse.tracecompass.tmf.core.trace.indexer.ITmfTraceIndexer;
60 import org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
61 import org.eclipse.tracecompass.tmf.core.trace.location.ITmfLocation;
62
63 import com.google.common.collect.ImmutableList;
64
65 /**
66 * Abstract implementation of ITmfTrace.
67 * <p>
68 * Since the concept of 'location' is trace specific, the concrete classes have
69 * to provide the related methods, namely:
70 * <ul>
71 * <li> public ITmfLocation<?> getCurrentLocation()
72 * <li> public double getLocationRatio(ITmfLocation<?> location)
73 * <li> public ITmfContext seekEvent(ITmfLocation<?> location)
74 * <li> public ITmfContext seekEvent(double ratio)
75 * <li> public IStatus validate(IProject project, String path)
76 * </ul>
77 * <p>
78 * When constructing an event, the concrete trace should use the trace's
79 * timestamp transform to create the timestamp, by either transforming the
80 * parsed time value directly or by using the method createTimestamp().
81 * <p>
82 * The concrete class can either specify its own indexer or use the provided
83 * TmfCheckpointIndexer (default). In this case, the trace cache size will be
84 * used as checkpoint interval.
85 *
86 * @version 1.0
87 * @author Francois Chouinard
88 *
89 * @see ITmfEvent
90 * @see ITmfTraceIndexer
91 * @see ITmfEventParser
92 */
93 public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, ITmfEventParser, ITmfTraceCompleteness {
94
95 // ------------------------------------------------------------------------
96 // Class attributes
97 // ------------------------------------------------------------------------
98
99 /**
100 * Basic aspects that should be valid for all trace types.
101 */
102 public static final @NonNull Collection<@NonNull ITmfEventAspect> BASE_ASPECTS =
103 checkNotNull(ImmutableList.of(
104 ITmfEventAspect.BaseAspects.TIMESTAMP,
105 ITmfEventAspect.BaseAspects.EVENT_TYPE,
106 ITmfEventAspect.BaseAspects.CONTENTS
107 ));
108
109 // ------------------------------------------------------------------------
110 // Instance attributes
111 // ------------------------------------------------------------------------
112
113 // The resource used for persistent properties for this trace
114 private IResource fResource;
115
116 // The trace type id
117 private @Nullable String fTraceTypeId;
118
119 // The trace path
120 private String fPath;
121
122 // The trace cache page size
123 private int fCacheSize = ITmfTrace.DEFAULT_TRACE_CACHE_SIZE;
124
125 // The number of events collected (so far)
126 private volatile long fNbEvents = 0;
127
128 // The time span of the event stream
129 private @NonNull ITmfTimestamp fStartTime = TmfTimestamp.BIG_BANG;
130 private @NonNull ITmfTimestamp fEndTime = TmfTimestamp.BIG_BANG;
131
132 // The trace streaming interval (0 = no streaming)
133 private long fStreamingInterval = 0;
134
135 // The trace indexer
136 private ITmfTraceIndexer fIndexer;
137
138 private ITmfTimestampTransform fTsTransform;
139
140 private final Map<String, IAnalysisModule> fAnalysisModules =
141 Collections.synchronizedMap(new LinkedHashMap<String, IAnalysisModule>());
142
143 // ------------------------------------------------------------------------
144 // Construction
145 // ------------------------------------------------------------------------
146
147 /**
148 * The default, parameterless, constructor
149 */
150 public TmfTrace() {
151 super();
152 fIndexer = new TmfCheckpointIndexer(this);
153 }
154
155 /**
156 * Full constructor.
157 *
158 * @param resource
159 * The resource associated to the trace
160 * @param type
161 * The type of events that will be read from this trace
162 * @param path
163 * The path to the trace on the filesystem
164 * @param cacheSize
165 * The trace cache size. Pass '-1' to use the default specified
166 * in {@link ITmfTrace#DEFAULT_TRACE_CACHE_SIZE}
167 * @param interval
168 * The trace streaming interval. You can use '0' for post-mortem
169 * traces.
170 * @throws TmfTraceException
171 * If something failed during the opening
172 */
173 protected TmfTrace(final IResource resource,
174 final Class<? extends ITmfEvent> type,
175 final String path,
176 final int cacheSize,
177 final long interval)
178 throws TmfTraceException {
179 super();
180 fCacheSize = (cacheSize > 0) ? cacheSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE;
181 fStreamingInterval = interval;
182 initialize(resource, path, type);
183 }
184
185 /**
186 * Copy constructor
187 *
188 * @param trace the original trace
189 * @throws TmfTraceException Should not happen usually
190 */
191 public TmfTrace(final TmfTrace trace) throws TmfTraceException {
192 super();
193 if (trace == null) {
194 throw new IllegalArgumentException();
195 }
196 fCacheSize = trace.getCacheSize();
197 fStreamingInterval = trace.getStreamingInterval();
198 initialize(trace.getResource(), trace.getPath(), trace.getEventType());
199 }
200
201 /**
202 * Creates the indexer instance. Classes extending this class can override
203 * this to provide a different indexer implementation.
204 *
205 * @param interval the checkpoints interval
206 *
207 * @return the indexer
208 */
209 protected ITmfTraceIndexer createIndexer(int interval) {
210 return new TmfCheckpointIndexer(this, interval);
211 }
212
213 // ------------------------------------------------------------------------
214 // ITmfTrace - Initializers
215 // ------------------------------------------------------------------------
216
217 @Override
218 public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type, String name, String traceTypeId) throws TmfTraceException {
219 if (name == null) {
220 throw new IllegalArgumentException();
221 }
222 setName(name);
223 fTraceTypeId = traceTypeId;
224 initTrace(resource, path, type);
225 }
226
227 @Override
228 public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
229 initialize(resource, path, type);
230 }
231
232 /**
233 * Initialize the trace common attributes and the base component.
234 *
235 * @param resource the Eclipse resource (trace)
236 * @param path the trace path
237 * @param type the trace event type
238 *
239 * @throws TmfTraceException If something failed during the initialization
240 */
241 protected void initialize(final IResource resource,
242 final String path,
243 final Class<? extends ITmfEvent> type)
244 throws TmfTraceException {
245 if (path == null) {
246 throw new TmfTraceException("Invalid trace path"); //$NON-NLS-1$
247 }
248 fPath = path;
249 fResource = resource;
250 String traceName = getName();
251 if (traceName.isEmpty()) {
252 traceName = (resource != null) ? resource.getName() : new Path(path).lastSegment();
253 }
254 super.init(traceName, type);
255 // register as VIP after super.init() because TmfComponent registers to signal manager there
256 TmfSignalManager.registerVIP(this);
257 if (fIndexer != null) {
258 fIndexer.dispose();
259 }
260 fIndexer = createIndexer(fCacheSize);
261 }
262
263 /**
264 * Indicates if the path points to an existing file/directory
265 *
266 * @param path the path to test
267 * @return true if the file/directory exists
268 */
269 protected boolean fileExists(final String path) {
270 final File file = new File(path);
271 return file.exists();
272 }
273
274 @Override
275 public void indexTrace(boolean waitForCompletion) {
276 getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, waitForCompletion);
277 }
278
279 /**
280 * Instantiate the applicable analysis modules and executes the analysis
281 * modules that are meant to be automatically executed
282 *
283 * @return An IStatus indicating whether the analysis could be run
284 * successfully or not
285 */
286 protected IStatus executeAnalysis() {
287 MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
288
289 /* First modules are initialized */
290 Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(this.getClass());
291 for (IAnalysisModuleHelper helper : modules.values()) {
292 try {
293 IAnalysisModule module = helper.newModule(this);
294 if (module == null) {
295 continue;
296 }
297 fAnalysisModules.put(module.getId(), module);
298 } catch (TmfAnalysisException e) {
299 status.add(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
300 }
301 }
302
303 /* Once all modules are initialized, automatic modules are executed */
304 for (IAnalysisModule module : getAnalysisModules()) {
305 if (module.isAutomatic()) {
306 status.add(module.schedule());
307 }
308 }
309 return status;
310 }
311
312 @Override
313 public IAnalysisModule getAnalysisModule(String analysisId) {
314 return fAnalysisModules.get(analysisId);
315 }
316
317
318 @Override
319 public Iterable<IAnalysisModule> getAnalysisModules() {
320 synchronized (fAnalysisModules) {
321 Set<IAnalysisModule> modules = new HashSet<>(fAnalysisModules.values());
322 return modules;
323 }
324 }
325
326 @Override
327 public Iterable<ITmfEventAspect> getEventAspects() {
328 /* By default we provide only the base aspects valid for all trace types */
329 return BASE_ASPECTS;
330 }
331
332 /**
333 * Clears the trace
334 */
335 @Override
336 public synchronized void dispose() {
337 /* Clean up the index if applicable */
338 if (getIndexer() != null) {
339 getIndexer().dispose();
340 }
341
342 /* Clean up the analysis modules */
343 synchronized (fAnalysisModules) {
344 for (IAnalysisModule module : fAnalysisModules.values()) {
345 module.dispose();
346 }
347 fAnalysisModules.clear();
348 }
349
350 super.dispose();
351 }
352
353 // ------------------------------------------------------------------------
354 // ITmfTrace - Basic getters
355 // ------------------------------------------------------------------------
356
357 @Override
358 public IResource getResource() {
359 return fResource;
360 }
361
362 @Override
363 public @Nullable String getTraceTypeId() {
364 return fTraceTypeId;
365 }
366
367 @Override
368 public String getPath() {
369 return fPath;
370 }
371
372 @Override
373 public int getCacheSize() {
374 return fCacheSize;
375 }
376
377 @Override
378 public long getStreamingInterval() {
379 return fStreamingInterval;
380 }
381
382 /**
383 * @return the trace indexer
384 */
385 protected ITmfTraceIndexer getIndexer() {
386 return fIndexer;
387 }
388
389 // ------------------------------------------------------------------------
390 // ITmfTrace - Trace characteristics getters
391 // ------------------------------------------------------------------------
392
393 @Override
394 public long getNbEvents() {
395 return fNbEvents;
396 }
397
398 @Override
399 public @NonNull TmfTimeRange getTimeRange() {
400 return new TmfTimeRange(fStartTime, fEndTime);
401 }
402
403 @Override
404 public ITmfTimestamp getStartTime() {
405 return fStartTime;
406 }
407
408 @Override
409 public ITmfTimestamp getEndTime() {
410 return fEndTime;
411 }
412
413 @Override
414 public ITmfTimestamp getInitialRangeOffset() {
415 final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); // .1sec
416 return new TmfTimestamp(DEFAULT_INITIAL_OFFSET_VALUE, ITmfTimestamp.NANOSECOND_SCALE);
417 }
418
419 @Override
420 public String getHostId() {
421 return this.getName();
422 }
423
424 // ------------------------------------------------------------------------
425 // Convenience setters
426 // ------------------------------------------------------------------------
427
428 /**
429 * Set the trace cache size. Must be done at initialization time.
430 *
431 * @param cacheSize The trace cache size
432 */
433 protected void setCacheSize(final int cacheSize) {
434 fCacheSize = cacheSize;
435 }
436
437 /**
438 * Set the trace known number of events. This can be quite dynamic
439 * during indexing or for live traces.
440 *
441 * @param nbEvents The number of events
442 */
443 protected synchronized void setNbEvents(final long nbEvents) {
444 fNbEvents = (nbEvents > 0) ? nbEvents : 0;
445 }
446
447 /**
448 * Update the trace events time range
449 *
450 * @param range the new time range
451 */
452 protected void setTimeRange(final @NonNull TmfTimeRange range) {
453 fStartTime = range.getStartTime();
454 fEndTime = range.getEndTime();
455 }
456
457 /**
458 * Update the trace chronologically first event timestamp
459 *
460 * @param startTime the new first event timestamp
461 */
462 protected void setStartTime(final @NonNull ITmfTimestamp startTime) {
463 fStartTime = startTime;
464 }
465
466 /**
467 * Update the trace chronologically last event timestamp
468 *
469 * @param endTime the new last event timestamp
470 */
471 protected void setEndTime(final @NonNull ITmfTimestamp endTime) {
472 fEndTime = endTime;
473 }
474
475 /**
476 * Set the polling interval for live traces (default = 0 = no streaming).
477 *
478 * @param interval the new trace streaming interval
479 */
480 protected void setStreamingInterval(final long interval) {
481 fStreamingInterval = (interval > 0) ? interval : 0;
482 }
483
484 // ------------------------------------------------------------------------
485 // ITmfTrace - SeekEvent operations (returning a trace context)
486 // ------------------------------------------------------------------------
487
488 @Override
489 public synchronized ITmfContext seekEvent(final long rank) {
490
491 // A rank <= 0 indicates to seek the first event
492 if (rank <= 0) {
493 ITmfContext context = seekEvent((ITmfLocation) null);
494 context.setRank(0);
495 return context;
496 }
497
498 // Position the trace at the checkpoint
499 final ITmfContext context = fIndexer.seekIndex(rank);
500
501 // And locate the requested event context
502 long pos = context.getRank();
503 if (pos < rank) {
504 ITmfEvent event = getNext(context);
505 while ((event != null) && (++pos < rank)) {
506 event = getNext(context);
507 }
508 }
509 return context;
510 }
511
512 @Override
513 public synchronized ITmfContext seekEvent(final ITmfTimestamp timestamp) {
514
515 // A null timestamp indicates to seek the first event
516 if (timestamp == null) {
517 ITmfContext context = seekEvent((ITmfLocation) null);
518 context.setRank(0);
519 return context;
520 }
521
522 // Position the trace at the checkpoint
523 ITmfContext context = fIndexer.seekIndex(timestamp);
524
525 // And locate the requested event context
526 ITmfLocation previousLocation = context.getLocation();
527 long previousRank = context.getRank();
528 ITmfEvent event = getNext(context);
529 while (event != null && event.getTimestamp().compareTo(timestamp) < 0) {
530 previousLocation = context.getLocation();
531 previousRank = context.getRank();
532 event = getNext(context);
533 }
534 if (event == null) {
535 context.setLocation(null);
536 context.setRank(ITmfContext.UNKNOWN_RANK);
537 } else {
538 context.dispose();
539 context = seekEvent(previousLocation);
540 context.setRank(previousRank);
541 }
542 return context;
543 }
544
545 // ------------------------------------------------------------------------
546 // Read operations (returning an actual event)
547 // ------------------------------------------------------------------------
548
549 @Override
550 public abstract ITmfEvent parseEvent(ITmfContext context);
551
552 @Override
553 public synchronized ITmfEvent getNext(final ITmfContext context) {
554 // parseEvent() does not update the context
555 final ITmfEvent event = parseEvent(context);
556 if (event != null) {
557 updateAttributes(context, event);
558 context.setLocation(getCurrentLocation());
559 context.increaseRank();
560 }
561 return event;
562 }
563
564 /**
565 * Update the trace attributes
566 *
567 * @param context the current trace context
568 * @param timestamp the corresponding timestamp
569 * @deprecated Use {@link #updateAttributes(ITmfContext, ITmfEvent)}
570 */
571 @Deprecated
572 protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfTimestamp timestamp) {
573 updateAttributes(context, new TmfEvent(this, context.getRank(), timestamp, null, null));
574 }
575
576 /**
577 * Update the trace attributes
578 *
579 * @param context the current trace context
580 * @param event the corresponding event
581 * @since 1.1
582 */
583 protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfEvent event) {
584 ITmfTimestamp timestamp = event.getTimestamp();
585 ITmfTimestamp endTime = timestamp;
586 if (event instanceof ITmfLostEvent) {
587 endTime = ((ITmfLostEvent) event).getTimeRange().getEndTime();
588 }
589 if (fStartTime.equals(TmfTimestamp.BIG_BANG) || (fStartTime.compareTo(timestamp) > 0)) {
590 fStartTime = timestamp;
591 }
592 if (fEndTime.equals(TmfTimestamp.BIG_CRUNCH) || (fEndTime.compareTo(endTime) < 0)) {
593 fEndTime = endTime;
594 }
595 if (context.hasValidRank()) {
596 long rank = context.getRank();
597 if (fNbEvents <= rank) {
598 fNbEvents = rank + 1;
599 }
600 if (fIndexer != null) {
601 fIndexer.updateIndex(context, timestamp);
602 }
603 }
604 }
605
606 // ------------------------------------------------------------------------
607 // TmfDataProvider
608 // ------------------------------------------------------------------------
609
610 @Override
611 public synchronized ITmfContext armRequest(final ITmfEventRequest request) {
612 if (executorIsShutdown()) {
613 return null;
614 }
615 if (!TmfTimestamp.BIG_BANG.equals(request.getRange().getStartTime())
616 && (request.getIndex() == 0)) {
617 final ITmfContext context = seekEvent(request.getRange().getStartTime());
618 request.setStartIndex((int) context.getRank());
619 return context;
620
621 }
622 return seekEvent(request.getIndex());
623 }
624
625 // ------------------------------------------------------------------------
626 // Signal handlers
627 // ------------------------------------------------------------------------
628
629 /**
630 * Handler for the Trace Opened signal
631 *
632 * @param signal
633 * The incoming signal
634 */
635 @TmfSignalHandler
636 public void traceOpened(TmfTraceOpenedSignal signal) {
637 boolean signalIsForUs = false;
638 for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) {
639 if (trace == this) {
640 signalIsForUs = true;
641 break;
642 }
643 }
644
645 if (!signalIsForUs) {
646 return;
647 }
648
649 /*
650 * The signal is either for this trace, or for an experiment containing
651 * this trace.
652 */
653 IStatus status = executeAnalysis();
654 if (!status.isOK()) {
655 Activator.log(status);
656 }
657
658 TmfTraceManager.refreshSupplementaryFiles(this);
659
660 if (signal.getTrace() == this) {
661 /* Additionally, the signal is directly for this trace. */
662 if (getNbEvents() == 0) {
663 return;
664 }
665
666 /* For a streaming trace, the range updated signal should be sent
667 * by the subclass when a new safe time is determined.
668 */
669 if (getStreamingInterval() > 0) {
670 return;
671 }
672
673 if (isComplete()) {
674 final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH);
675 final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange);
676
677 // Broadcast in separate thread to prevent deadlock
678 broadcastAsync(rangeUpdatedsignal);
679 }
680 return;
681 }
682 }
683
684 /**
685 * Signal handler for the TmfTraceRangeUpdatedSignal signal
686 *
687 * @param signal The incoming signal
688 */
689 @TmfSignalHandler
690 public void traceRangeUpdated(final TmfTraceRangeUpdatedSignal signal) {
691 if (signal.getTrace() == this) {
692 getIndexer().buildIndex(getNbEvents(), signal.getRange(), false);
693 }
694 }
695
696 /**
697 * Signal handler for the TmfTraceUpdatedSignal signal
698 *
699 * @param signal The incoming signal
700 */
701 @TmfSignalHandler
702 public void traceUpdated(final TmfTraceUpdatedSignal signal) {
703 if (signal.getSource() == getIndexer()) {
704 fNbEvents = signal.getNbEvents();
705 fStartTime = signal.getRange().getStartTime();
706 fEndTime = signal.getRange().getEndTime();
707 }
708 }
709
710 // ------------------------------------------------------------------------
711 // Timestamp transformation functions
712 // ------------------------------------------------------------------------
713
714 @Override
715 public ITmfTimestampTransform getTimestampTransform() {
716 if (fTsTransform == null) {
717 fTsTransform = TimestampTransformFactory.getTimestampTransform(getResource());
718 }
719 return fTsTransform;
720 }
721
722 @Override
723 public void setTimestampTransform(final ITmfTimestampTransform tt) {
724 fTsTransform = tt;
725 TimestampTransformFactory.setTimestampTransform(getResource(), tt);
726 }
727
728 @Override
729 public @NonNull ITmfTimestamp createTimestamp(long ts) {
730 return new TmfNanoTimestamp(getTimestampTransform().transform(ts));
731 }
732
733 // ------------------------------------------------------------------------
734 // toString
735 // ------------------------------------------------------------------------
736
737 @Override
738 @SuppressWarnings("nls")
739 public synchronized String toString() {
740 return "TmfTrace [fPath=" + fPath + ", fCacheSize=" + fCacheSize
741 + ", fNbEvents=" + fNbEvents + ", fStartTime=" + fStartTime
742 + ", fEndTime=" + fEndTime + ", fStreamingInterval=" + fStreamingInterval + "]";
743 }
744
745 @Override
746 public boolean isComplete() {
747 /*
748 * Be default, all traces are "complete" which means no more data will
749 * be added later
750 */
751 return true;
752 }
753
754 @Override
755 public void setComplete(boolean isComplete) {
756 /*
757 * This should be overridden by trace classes that can support live
758 * reading (traces in an incomplete state)
759 */
760 }
761 }
This page took 0.048009 seconds and 6 git commands to generate.