Remove unneeded checkNotNull() calls
[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 java.io.File;
20 import java.util.Collection;
21 import java.util.Collections;
22 import java.util.HashSet;
23 import java.util.LinkedHashMap;
24 import java.util.Map;
25 import java.util.Set;
26
27 import org.eclipse.core.resources.IResource;
28 import org.eclipse.core.runtime.IStatus;
29 import org.eclipse.core.runtime.MultiStatus;
30 import org.eclipse.core.runtime.Path;
31 import org.eclipse.core.runtime.Status;
32 import org.eclipse.jdt.annotation.NonNull;
33 import org.eclipse.jdt.annotation.Nullable;
34 import org.eclipse.tracecompass.internal.tmf.core.Activator;
35 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
36 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
37 import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager;
38 import org.eclipse.tracecompass.tmf.core.component.TmfEventProvider;
39 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
40 import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
41 import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
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<@NonNull ITmfEventAspect> BASE_ASPECTS =
101 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 @NonNull ITmfTimestamp fStartTime = TmfTimestamp.BIG_BANG;
128 private @NonNull 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 = new TmfCheckpointIndexer(this);
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 */
207 protected ITmfTraceIndexer createIndexer(int interval) {
208 return new TmfCheckpointIndexer(this, interval);
209 }
210
211 // ------------------------------------------------------------------------
212 // ITmfTrace - Initializers
213 // ------------------------------------------------------------------------
214
215 @Override
216 public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type, String name, String traceTypeId) throws TmfTraceException {
217 if (name == null) {
218 throw new IllegalArgumentException();
219 }
220 setName(name);
221 fTraceTypeId = traceTypeId;
222 initTrace(resource, path, type);
223 }
224
225 @Override
226 public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
227 initialize(resource, path, type);
228 }
229
230 /**
231 * Initialize the trace common attributes and the base component.
232 *
233 * @param resource the Eclipse resource (trace)
234 * @param path the trace path
235 * @param type the trace event type
236 *
237 * @throws TmfTraceException If something failed during the initialization
238 */
239 protected void initialize(final IResource resource,
240 final String path,
241 final Class<? extends ITmfEvent> type)
242 throws TmfTraceException {
243 if (path == null) {
244 throw new TmfTraceException("Invalid trace path"); //$NON-NLS-1$
245 }
246 fPath = path;
247 fResource = resource;
248 String traceName = getName();
249 if (traceName.isEmpty()) {
250 traceName = (resource != null) ? resource.getName() : new Path(path).lastSegment();
251 }
252 super.init(traceName, type);
253 // register as VIP after super.init() because TmfComponent registers to signal manager there
254 TmfSignalManager.registerVIP(this);
255 if (fIndexer != null) {
256 fIndexer.dispose();
257 }
258 fIndexer = createIndexer(fCacheSize);
259 }
260
261 /**
262 * Indicates if the path points to an existing file/directory
263 *
264 * @param path the path to test
265 * @return true if the file/directory exists
266 */
267 protected boolean fileExists(final String path) {
268 final File file = new File(path);
269 return file.exists();
270 }
271
272 @Override
273 public void indexTrace(boolean waitForCompletion) {
274 getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, waitForCompletion);
275 }
276
277 /**
278 * Instantiate the applicable analysis modules and executes the analysis
279 * modules that are meant to be automatically executed
280 *
281 * @return An IStatus indicating whether the analysis could be run
282 * successfully or not
283 */
284 protected IStatus executeAnalysis() {
285 MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
286
287 /* First modules are initialized */
288 Map<String, IAnalysisModuleHelper> modules = TmfAnalysisManager.getAnalysisModules(this.getClass());
289 for (IAnalysisModuleHelper helper : modules.values()) {
290 try {
291 IAnalysisModule module = helper.newModule(this);
292 if (module == null) {
293 continue;
294 }
295 fAnalysisModules.put(module.getId(), module);
296 } catch (TmfAnalysisException e) {
297 status.add(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()));
298 }
299 }
300
301 /* Once all modules are initialized, automatic modules are executed */
302 for (IAnalysisModule module : getAnalysisModules()) {
303 if (module.isAutomatic()) {
304 status.add(module.schedule());
305 }
306 }
307 return status;
308 }
309
310 @Override
311 public IAnalysisModule getAnalysisModule(String analysisId) {
312 return fAnalysisModules.get(analysisId);
313 }
314
315
316 @Override
317 public Iterable<IAnalysisModule> getAnalysisModules() {
318 synchronized (fAnalysisModules) {
319 Set<IAnalysisModule> modules = new HashSet<>(fAnalysisModules.values());
320 return modules;
321 }
322 }
323
324 @Override
325 public Iterable<ITmfEventAspect> getEventAspects() {
326 /* By default we provide only the base aspects valid for all trace types */
327 return BASE_ASPECTS;
328 }
329
330 /**
331 * Clears the trace
332 */
333 @Override
334 public synchronized void dispose() {
335 /* Clean up the index if applicable */
336 if (getIndexer() != null) {
337 getIndexer().dispose();
338 }
339
340 /* Clean up the analysis modules */
341 synchronized (fAnalysisModules) {
342 for (IAnalysisModule module : fAnalysisModules.values()) {
343 module.dispose();
344 }
345 fAnalysisModules.clear();
346 }
347
348 super.dispose();
349 }
350
351 // ------------------------------------------------------------------------
352 // ITmfTrace - Basic getters
353 // ------------------------------------------------------------------------
354
355 @Override
356 public IResource getResource() {
357 return fResource;
358 }
359
360 @Override
361 public @Nullable String getTraceTypeId() {
362 return fTraceTypeId;
363 }
364
365 @Override
366 public String getPath() {
367 return fPath;
368 }
369
370 @Override
371 public int getCacheSize() {
372 return fCacheSize;
373 }
374
375 @Override
376 public long getStreamingInterval() {
377 return fStreamingInterval;
378 }
379
380 /**
381 * @return the trace indexer
382 */
383 protected ITmfTraceIndexer getIndexer() {
384 return fIndexer;
385 }
386
387 // ------------------------------------------------------------------------
388 // ITmfTrace - Trace characteristics getters
389 // ------------------------------------------------------------------------
390
391 @Override
392 public long getNbEvents() {
393 return fNbEvents;
394 }
395
396 @Override
397 public @NonNull TmfTimeRange getTimeRange() {
398 return new TmfTimeRange(fStartTime, fEndTime);
399 }
400
401 @Override
402 public ITmfTimestamp getStartTime() {
403 return fStartTime;
404 }
405
406 @Override
407 public ITmfTimestamp getEndTime() {
408 return fEndTime;
409 }
410
411 @Override
412 public ITmfTimestamp getInitialRangeOffset() {
413 final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); // .1sec
414 return new TmfTimestamp(DEFAULT_INITIAL_OFFSET_VALUE, ITmfTimestamp.NANOSECOND_SCALE);
415 }
416
417 @Override
418 public String getHostId() {
419 return this.getName();
420 }
421
422 // ------------------------------------------------------------------------
423 // Convenience setters
424 // ------------------------------------------------------------------------
425
426 /**
427 * Set the trace cache size. Must be done at initialization time.
428 *
429 * @param cacheSize The trace cache size
430 */
431 protected void setCacheSize(final int cacheSize) {
432 fCacheSize = cacheSize;
433 }
434
435 /**
436 * Set the trace known number of events. This can be quite dynamic
437 * during indexing or for live traces.
438 *
439 * @param nbEvents The number of events
440 */
441 protected synchronized void setNbEvents(final long nbEvents) {
442 fNbEvents = (nbEvents > 0) ? nbEvents : 0;
443 }
444
445 /**
446 * Update the trace events time range
447 *
448 * @param range the new time range
449 */
450 protected void setTimeRange(final @NonNull TmfTimeRange range) {
451 fStartTime = range.getStartTime();
452 fEndTime = range.getEndTime();
453 }
454
455 /**
456 * Update the trace chronologically first event timestamp
457 *
458 * @param startTime the new first event timestamp
459 */
460 protected void setStartTime(final @NonNull ITmfTimestamp startTime) {
461 fStartTime = startTime;
462 }
463
464 /**
465 * Update the trace chronologically last event timestamp
466 *
467 * @param endTime the new last event timestamp
468 */
469 protected void setEndTime(final @NonNull ITmfTimestamp endTime) {
470 fEndTime = endTime;
471 }
472
473 /**
474 * Set the polling interval for live traces (default = 0 = no streaming).
475 *
476 * @param interval the new trace streaming interval
477 */
478 protected void setStreamingInterval(final long interval) {
479 fStreamingInterval = (interval > 0) ? interval : 0;
480 }
481
482 // ------------------------------------------------------------------------
483 // ITmfTrace - SeekEvent operations (returning a trace context)
484 // ------------------------------------------------------------------------
485
486 @Override
487 public synchronized ITmfContext seekEvent(final long rank) {
488
489 // A rank <= 0 indicates to seek the first event
490 if (rank <= 0) {
491 ITmfContext context = seekEvent((ITmfLocation) null);
492 context.setRank(0);
493 return context;
494 }
495
496 // Position the trace at the checkpoint
497 final ITmfContext context = fIndexer.seekIndex(rank);
498
499 // And locate the requested event context
500 long pos = context.getRank();
501 if (pos < rank) {
502 ITmfEvent event = getNext(context);
503 while ((event != null) && (++pos < rank)) {
504 event = getNext(context);
505 }
506 }
507 return context;
508 }
509
510 @Override
511 public synchronized ITmfContext seekEvent(final ITmfTimestamp timestamp) {
512
513 // A null timestamp indicates to seek the first event
514 if (timestamp == null) {
515 ITmfContext context = seekEvent((ITmfLocation) null);
516 context.setRank(0);
517 return context;
518 }
519
520 // Position the trace at the checkpoint
521 ITmfContext context = fIndexer.seekIndex(timestamp);
522
523 // And locate the requested event context
524 ITmfLocation previousLocation = context.getLocation();
525 long previousRank = context.getRank();
526 ITmfEvent event = getNext(context);
527 while (event != null && event.getTimestamp().compareTo(timestamp) < 0) {
528 previousLocation = context.getLocation();
529 previousRank = context.getRank();
530 event = getNext(context);
531 }
532 if (event == null) {
533 context.setLocation(null);
534 context.setRank(ITmfContext.UNKNOWN_RANK);
535 } else {
536 context.dispose();
537 context = seekEvent(previousLocation);
538 context.setRank(previousRank);
539 }
540 return context;
541 }
542
543 // ------------------------------------------------------------------------
544 // Read operations (returning an actual event)
545 // ------------------------------------------------------------------------
546
547 @Override
548 public abstract ITmfEvent parseEvent(ITmfContext context);
549
550 @Override
551 public synchronized ITmfEvent getNext(final ITmfContext context) {
552 // parseEvent() does not update the context
553 final ITmfEvent event = parseEvent(context);
554 if (event != null) {
555 updateAttributes(context, event);
556 context.setLocation(getCurrentLocation());
557 context.increaseRank();
558 }
559 return event;
560 }
561
562 /**
563 * Update the trace attributes
564 *
565 * @param context the current trace context
566 * @param timestamp the corresponding timestamp
567 * @deprecated Use {@link #updateAttributes(ITmfContext, ITmfEvent)}
568 */
569 @Deprecated
570 protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfTimestamp timestamp) {
571 updateAttributes(context, new TmfEvent(this, context.getRank(), timestamp, null, null));
572 }
573
574 /**
575 * Update the trace attributes
576 *
577 * @param context the current trace context
578 * @param event the corresponding event
579 * @since 1.1
580 */
581 protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfEvent event) {
582 ITmfTimestamp timestamp = event.getTimestamp();
583 ITmfTimestamp endTime = timestamp;
584 if (event instanceof ITmfLostEvent) {
585 endTime = ((ITmfLostEvent) event).getTimeRange().getEndTime();
586 }
587 if (fStartTime.equals(TmfTimestamp.BIG_BANG) || (fStartTime.compareTo(timestamp) > 0)) {
588 fStartTime = timestamp;
589 }
590 if (fEndTime.equals(TmfTimestamp.BIG_CRUNCH) || (fEndTime.compareTo(endTime) < 0)) {
591 fEndTime = endTime;
592 }
593 if (context.hasValidRank()) {
594 long rank = context.getRank();
595 if (fNbEvents <= rank) {
596 fNbEvents = rank + 1;
597 }
598 if (fIndexer != null) {
599 fIndexer.updateIndex(context, timestamp);
600 }
601 }
602 }
603
604 // ------------------------------------------------------------------------
605 // TmfDataProvider
606 // ------------------------------------------------------------------------
607
608 @Override
609 public synchronized ITmfContext armRequest(final ITmfEventRequest request) {
610 if (executorIsShutdown()) {
611 return null;
612 }
613 if (!TmfTimestamp.BIG_BANG.equals(request.getRange().getStartTime())
614 && (request.getIndex() == 0)) {
615 final ITmfContext context = seekEvent(request.getRange().getStartTime());
616 request.setStartIndex((int) context.getRank());
617 return context;
618
619 }
620 return seekEvent(request.getIndex());
621 }
622
623 // ------------------------------------------------------------------------
624 // Signal handlers
625 // ------------------------------------------------------------------------
626
627 /**
628 * Handler for the Trace Opened signal
629 *
630 * @param signal
631 * The incoming signal
632 */
633 @TmfSignalHandler
634 public void traceOpened(TmfTraceOpenedSignal signal) {
635 boolean signalIsForUs = false;
636 for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) {
637 if (trace == this) {
638 signalIsForUs = true;
639 break;
640 }
641 }
642
643 if (!signalIsForUs) {
644 return;
645 }
646
647 /*
648 * The signal is either for this trace, or for an experiment containing
649 * this trace.
650 */
651 IStatus status = executeAnalysis();
652 if (!status.isOK()) {
653 Activator.log(status);
654 }
655
656 TmfTraceManager.refreshSupplementaryFiles(this);
657
658 if (signal.getTrace() == this) {
659 /* Additionally, the signal is directly for this trace. */
660 if (getNbEvents() == 0) {
661 return;
662 }
663
664 /* For a streaming trace, the range updated signal should be sent
665 * by the subclass when a new safe time is determined.
666 */
667 if (getStreamingInterval() > 0) {
668 return;
669 }
670
671 if (isComplete()) {
672 final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH);
673 final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange);
674
675 // Broadcast in separate thread to prevent deadlock
676 broadcastAsync(rangeUpdatedsignal);
677 }
678 return;
679 }
680 }
681
682 /**
683 * Signal handler for the TmfTraceRangeUpdatedSignal signal
684 *
685 * @param signal The incoming signal
686 */
687 @TmfSignalHandler
688 public void traceRangeUpdated(final TmfTraceRangeUpdatedSignal signal) {
689 if (signal.getTrace() == this) {
690 getIndexer().buildIndex(getNbEvents(), signal.getRange(), false);
691 }
692 }
693
694 /**
695 * Signal handler for the TmfTraceUpdatedSignal signal
696 *
697 * @param signal The incoming signal
698 */
699 @TmfSignalHandler
700 public void traceUpdated(final TmfTraceUpdatedSignal signal) {
701 if (signal.getSource() == getIndexer()) {
702 fNbEvents = signal.getNbEvents();
703 fStartTime = signal.getRange().getStartTime();
704 fEndTime = signal.getRange().getEndTime();
705 }
706 }
707
708 // ------------------------------------------------------------------------
709 // Timestamp transformation functions
710 // ------------------------------------------------------------------------
711
712 @Override
713 public ITmfTimestampTransform getTimestampTransform() {
714 if (fTsTransform == null) {
715 fTsTransform = TimestampTransformFactory.getTimestampTransform(getResource());
716 }
717 return fTsTransform;
718 }
719
720 @Override
721 public void setTimestampTransform(final ITmfTimestampTransform tt) {
722 fTsTransform = tt;
723 TimestampTransformFactory.setTimestampTransform(getResource(), tt);
724 }
725
726 @Override
727 public @NonNull ITmfTimestamp createTimestamp(long ts) {
728 return new TmfNanoTimestamp(getTimestampTransform().transform(ts));
729 }
730
731 // ------------------------------------------------------------------------
732 // toString
733 // ------------------------------------------------------------------------
734
735 @Override
736 @SuppressWarnings("nls")
737 public synchronized String toString() {
738 return "TmfTrace [fPath=" + fPath + ", fCacheSize=" + fCacheSize
739 + ", fNbEvents=" + fNbEvents + ", fStartTime=" + fStartTime
740 + ", fEndTime=" + fEndTime + ", fStreamingInterval=" + fStreamingInterval + "]";
741 }
742
743 @Override
744 public boolean isComplete() {
745 /*
746 * Be default, all traces are "complete" which means no more data will
747 * be added later
748 */
749 return true;
750 }
751
752 @Override
753 public void setComplete(boolean isComplete) {
754 /*
755 * This should be overridden by trace classes that can support live
756 * reading (traces in an incomplete state)
757 */
758 }
759 }
This page took 0.048792 seconds and 5 git commands to generate.