import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider;
import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider;
import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
*/
public PartialHistoryBackend(ITmfStateProvider partialInput, PartialStateSystem pss,
IStateHistoryBackend realBackend, long granularity) {
- if (granularity <= 0 || partialInput == null || pss == null) {
+ if (granularity <= 0 || partialInput == null || pss == null ||
+ partialInput.getAssignedStateSystem() != pss) {
throw new IllegalArgumentException();
}
- if (partialInput.getAssignedStateSystem() != pss) {
- throw new RuntimeException();
- }
final long startTime = realBackend.getStartTime();
* caused by the event(s) happening exactly at 'checkpointTime',
* if any. We must not include those events in the query.
*/
- new TmfTimestamp(checkpointTime + 1, -9),
- new TmfTimestamp(t, -9));
+ new TmfTimestamp(checkpointTime + 1, ITmfTimestamp.NANOSECOND_SCALE),
+ new TmfTimestamp(t, ITmfTimestamp.NANOSECOND_SCALE));
ITmfEventRequest request = new PartialStateSystemRequest(partialInput, range);
partialInput.getTrace().sendRequest(request);
private class CheckpointsRequest extends TmfEventRequest {
/** The amount of events queried at a time through the requests */
- private final static int chunkSize = 50000;
+ private static final int CHUNK_SIZE = 50000;
private final ITmfTrace trace;
private final Map<Long, Long> checkpts;
super(input.getExpectedEventType(),
TmfTimeRange.ETERNITY,
TmfDataRequest.ALL_DATA,
- chunkSize,
+ CHUNK_SIZE,
ITmfDataRequest.ExecutionType.BACKGROUND);
checkpoints.clear();
this.trace = input.getTrace();
this.checkpts = checkpoints;
- eventCount = lastCheckpointAt = 0;
+ eventCount = 0;
+ lastCheckpointAt = 0;
/* Insert a checkpoint at the start of the trace */
checkpoints.put(input.getStartTime(), 0L);
private class PartialStateSystemRequest extends TmfEventRequest {
- private final static int chunkSize = 50000;
+ private static final int CHUNK_SIZE = 50000;
private final ITmfStateProvider sci;
private final ITmfTrace trace;
super(sci.getExpectedEventType(),
range,
TmfDataRequest.ALL_DATA,
- chunkSize,
+ CHUNK_SIZE,
ITmfDataRequest.ExecutionType.BACKGROUND);
this.sci = sci;
this.trace = sci.getTrace();