private final Thread fEventHandlerThread;
private boolean fStateSystemAssigned;
-
/** State system in which to insert the state changes */
private @Nullable ITmfStateSystemBuilder fSS = null;
+ /* The last safe time at which this state provider can be queried */
+ private volatile long fSafeTime;
+
/**
* Instantiate a new state provider plugin.
*
fTrace = trace;
fEventsQueue = new BufferedBlockingQueue<>(DEFAULT_EVENTS_QUEUE_SIZE, DEFAULT_EVENTS_CHUNK_SIZE);
fStateSystemAssigned = false;
+ // set the safe time to before the trace start, the analysis has not yet started
+ fSafeTime = trace.getStartTime().toNanos() - 1;
fEventHandlerThread = new Thread(new EventProcessor(), id + " Event Handler"); //$NON-NLS-1$
}
return fTrace.getStartTime().toNanos();
}
+ /**
+ * @since 2.0
+ */
+ @Override
+ public long getLatestSafeTime() {
+ return fSafeTime;
+ }
+
@Override
public void assignTargetStateSystem(ITmfStateSystemBuilder ssb) {
fSS = ssb;
continue;
}
currentEvent = event;
+ fSafeTime = event.getTimestamp().toNanos() - 1;
eventHandle(event);
event = fEventsQueue.take();
}