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