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

jihao 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 ab59c19  [TE] add the applications to the alert search endpoint 
response (#5614)
ab59c19 is described below

commit ab59c1997714265d4f665e403439dfa7bbf1857b
Author: Jihao Zhang <jihzh...@linkedin.com>
AuthorDate: Wed Jun 24 16:34:57 2020 -0700

    [TE] add the applications to the alert search endpoint response (#5614)
    
    This PR adds the application field into the alert search endpoint's 
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-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to