apucher closed pull request #3616: [TE] subscription groups endpoint
URL: https://github.com/apache/incubator-pinot/pull/3616
 
 
   

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/detection/DetectionResource.java
 
b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/detection/DetectionResource.java
index 2647e9fd7f..9a6376a4af 100644
--- 
a/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/detection/DetectionResource.java
+++ 
b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/detection/DetectionResource.java
@@ -46,9 +46,11 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
@@ -122,6 +124,20 @@ public Response getDetectionAlertConfig(@ApiParam("the 
detection alert config id
     return Response.ok(config).build();
   }
 
+  @Path("/subscription-groups/{id}")
+  @GET
+  @ApiOperation("get a list of detection alert configs for a given detection 
config id")
+  public Response getSubscriptionGroups(@ApiParam("the detection config id") 
@PathParam("id") long id){
+    List<DetectionAlertConfigDTO> detectionAlertConfigDTOs = 
this.detectionAlertConfigDAO.findAll();
+    Set<DetectionAlertConfigDTO> subscriptionGroupAlertDTOs = new HashSet<>();
+    for (DetectionAlertConfigDTO alertConfigDTO : detectionAlertConfigDTOs){
+      if (alertConfigDTO.getVectorClocks().containsKey(id)){
+        subscriptionGroupAlertDTOs.add(alertConfigDTO);
+      }
+    }
+    return Response.ok(new ArrayList<>(subscriptionGroupAlertDTOs)).build();
+  }
+
   @POST
   @Path("/preview")
   public Response detectionPreview(


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to