import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.project.model.ITmfPropertiesProvider;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfNanoTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTraceProperties;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTraceWithPreDefinedEvents;
import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
* @author Matthew khouzam
*/
public class CtfTmfTrace extends TmfTrace
- implements ITmfTraceProperties, ITmfPersistentlyIndexable,
+ implements ITmfPropertiesProvider, ITmfPersistentlyIndexable,
ITmfTraceWithPreDefinedEvents {
// -------------------------------------------
// Constants
// -------------------------------------------
+ /**
+ * Clock offset property
+ * @since 2.0
+ */
+ public static final String CLOCK_OFFSET = "clock_offset"; //$NON-NLS-1$
+
/**
* Default cache size for CTF traces
*/
* Event aspects available for all CTF traces
* @since 1.0
*/
- protected static final @NonNull Collection<ITmfEventAspect> CTF_ASPECTS =
+ protected static final @NonNull Collection<@NonNull ITmfEventAspect> CTF_ASPECTS =
checkNotNull(ImmutableList.of(
ITmfEventAspect.BaseAspects.TIMESTAMP,
new CtfChannelAspect(),
// Fields
// -------------------------------------------
- private final Map<String, CtfTmfEventType> fContainedEventTypes =
- Collections.synchronizedMap(new HashMap<String, CtfTmfEventType>());
+ private final Map<@NonNull String, @NonNull CtfTmfEventType> fContainedEventTypes =
+ Collections.synchronizedMap(new HashMap<>());
- private final CtfIteratorManager fIteratorManager =
- new CtfIteratorManager(this);
+ private final CtfIteratorManager fIteratorManager = new CtfIteratorManager(this);
private final @NonNull CtfTmfEventFactory fEventFactory;
null,
content.toArray(new ITmfEventField[content.size()]));
- ctfTmfEventType = new CtfTmfEventType(ied.getName(), contentTree);
+ ctfTmfEventType = new CtfTmfEventType(checkNotNull(ied.getName()), contentTree);
fContainedEventTypes.put(ctfTmfEventType.getName(), ctfTmfEventType);
}
}
}
// -------------------------------------------
- // ITmfTraceProperties
+ // ITmfPropertiesProvider
// -------------------------------------------
+ /**
+ * @since 2.0
+ */
@Override
- public Map<String, String> getTraceProperties() {
+ public Map<String, String> getProperties() {
Map<String, String> properties = new HashMap<>();
properties.putAll(fTrace.getEnvironment());
+ properties.put(CLOCK_OFFSET, Long.toUnsignedString(fTrace.getOffset()));
properties.put(Messages.CtfTmfTrace_HostID, getHostId());
return properties;
}
* Gets the list of declared events
*/
@Override
- public Set<CtfTmfEventType> getContainedEventTypes() {
+ public Set<@NonNull CtfTmfEventType> getContainedEventTypes() {
return ImmutableSet.copyOf(fContainedEventTypes.values());
}