You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2020/06/24 22:39:37 UTC

[incubator-pinot] branch alerts-application created (now c76c122)

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

jihao pushed a change to branch alerts-application
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at c76c122  [TE] add the applications to the alert search endpoint response

This branch includes the following new commits:

     new c76c122  [TE] add the applications to the alert search endpoint response

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-pinot] 01/01: [TE] add the applications to the alert search endpoint response

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c76c12240648b3c2f75e79f43ddfd3e9677e455b
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Wed Jun 24 12:39:39 2020 -0700

    [TE] add the applications to the alert search endpoint response
---
 .../pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java
index c5aec8c..23fc6fe 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java
@@ -263,13 +263,17 @@ public class AlertSearcher {
 
     // join detections with subscription groups
     Multimap<Long, String> detectionIdToSubscriptionGroups = ArrayListMultimap.create();
+    Multimap<Long, String> detectionIdToApplications = ArrayListMultimap.create();
     for (DetectionAlertConfigDTO subscriptionGroup : subscriptionGroups) {
       for (long detectionConfigId : subscriptionGroup.getVectorClocks().keySet()) {
         detectionIdToSubscriptionGroups.put(detectionConfigId, subscriptionGroup.getName());
+        detectionIdToApplications.put(detectionConfigId, subscriptionGroup.getApplication());
       }
     }
     for (Map<String, Object> alert : alerts) {
-      alert.put("subscriptionGroup", detectionIdToSubscriptionGroups.get(MapUtils.getLong(alert, "id")));
+      long id = MapUtils.getLong(alert, "id");
+      alert.put("subscriptionGroup", detectionIdToSubscriptionGroups.get(id));
+      alert.put("application", new TreeSet<>(detectionIdToApplications.get(id)));
     }
 
     return ImmutableMap.of("count", count, "limit", searchQuery.limit, "offset", searchQuery.offset, "elements",


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