You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2018/11/19 23:45:48 UTC

[GitHub] apucher closed pull request #3518: [TE] rootcause - fix chunking offset cache

apucher closed pull request #3518: [TE] rootcause - fix chunking offset cache
URL: https://github.com/apache/incubator-pinot/pull/3518
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/dashboard/resources/v2/RootCauseMetricResource.java b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/dashboard/resources/v2/RootCauseMetricResource.java
index 11e9e2e257..ad2c3c84b3 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/dashboard/resources/v2/RootCauseMetricResource.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/dashboard/resources/v2/RootCauseMetricResource.java
@@ -256,15 +256,17 @@ public double getAggregate(@ApiParam(value = "metric urn", required = true) @Que
     offsets = ResourceUtils.parseListParams(offsets);
     List<MetricSlice> slices = new ArrayList<>();
 
-    Map<String, MetricSlice> offsetToBaseSlice = new HashMap<>();
+    Map<Pair<String, String>, MetricSlice> offsetToBaseSlice = new HashMap<>();
     Map<Pair<String, String>, Baseline> tupleToRange = new HashMap<>();
     for (String urn : urns) {
       for (String offset : offsets) {
+        Pair<String, String> key = Pair.of(urn, offset);
+
         MetricSlice baseSlice = alignSlice(makeSlice(urn, start, end), timezone);
-        offsetToBaseSlice.put(offset, baseSlice);
+        offsetToBaseSlice.put(key, baseSlice);
 
         Baseline range = parseOffset(offset, timezone);
-        tupleToRange.put(Pair.of(urn, offset), range);
+        tupleToRange.put(key, range);
 
         List<MetricSlice> currentSlices = range.scatter(baseSlice);
 
@@ -279,7 +281,8 @@ public double getAggregate(@ApiParam(value = "metric urn", required = true) @Que
     // Pick the results
     for (String urn : urns) {
       for (String offset : offsets) {
-        DataFrame result = tupleToRange.get(Pair.of(urn, offset)).gather(offsetToBaseSlice.get(offset), data);
+        Pair<String, String> key = Pair.of(urn, offset);
+        DataFrame result = tupleToRange.get(key).gather(offsetToBaseSlice.get(key), data);
         if (result.isEmpty()) {
           aggregateValues.put(urn, Double.NaN);
         } else {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org