From e132a19835f8734af377119afafa06e584ddecf6 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Mon, 23 Sep 2024 17:12:34 -0400 Subject: [PATCH] statesystem: Implement new query2D API in ThreadedHistoryTreeBackend 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 #158 [Fixed] Implement new query2D API in ThreadedHistoryTreeBackend\ Signed-off-by: Patrick Tasse --- .../core/backend/historytree/ThreadedHistoryTreeBackend.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java index 6374f97f42..92fbf2cc51 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java +++ b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java @@ -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$ @@ -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); } } }