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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to