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