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