You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ap...@apache.org on 2018/11/19 23:45:50 UTC

[incubator-pinot] branch master updated: [TE] rootcause - fix chunking offset cache (#3518)

This is an automated email from the ASF dual-hosted git repository.

apucher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c845ed  [TE] rootcause - fix chunking offset cache (#3518)
8c845ed is described below

commit 8c845ed5d662dd730391cbb2b49e85cfee1a42c8
Author: Alexander Pucher <ap...@linkedin.com>
AuthorDate: Mon Nov 19 15:45:46 2018 -0800

    [TE] rootcause - fix chunking offset cache (#3518)
---
 .../dashboard/resources/v2/RootCauseMetricResource.java       | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

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 11e9e2e..ad2c3c8 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 class RootCauseMetricResource {
     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 class RootCauseMetricResource {
     // 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 {


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