Skip to content

Commit

Permalink
statesystem: Implement new query2D API in ThreadedHistoryTreeBackend
Browse files Browse the repository at this point in the history
The new API for query2D with reverse parameter is implemented in
ThreadedHistoryTreeBackend. This avoids the base class implementation
from being used, which is missing queued intervals.

Fixes eclipse-tracecompass#158

[Fixed] Implement new query2D API in ThreadedHistoryTreeBackend\

Signed-off-by: Patrick Tasse <[email protected]>
  • Loading branch information
PatrickTasse committed Sep 23, 2024
1 parent 945b92e commit 578f3ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public ITmfStateInterval doSingularQuery(long t, int attributeQuark)
}

@Override
public Iterable<@NonNull ITmfStateInterval> query2D(IntegerRangeCondition quarks, TimeRangeCondition times)
public Iterable<@NonNull ITmfStateInterval> query2D(IntegerRangeCondition quarks, TimeRangeCondition times, boolean reverse)
throws TimeRangeException {
try (TraceCompassLogUtils.ScopeLog log = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINEST, "ThreadedHistoryTreeBackend:query2D", //$NON-NLS-1$
"ssid", getSSID(), //$NON-NLS-1$
Expand All @@ -311,7 +311,7 @@ public ITmfStateInterval doSingularQuery(long t, int attributeQuark)
Iterable<@NonNull HTInterval> queuedIntervals = Iterables.filter(intervalQueue,
interval -> !isFinishedBuilding() && quarks.test(interval.getAttribute())
&& times.intersects(interval.getStartTime(), interval.getEndTime()));
return Iterables.concat(super.query2D(quarks, times), queuedIntervals);
return Iterables.concat(super.query2D(quarks, times, reverse), queuedIntervals);
}
}
}

0 comments on commit 578f3ec

Please sign in to comment.