xiaohui-sun commented on a change in pull request #4763: [TE] endpoints - 
harleyjj/alert-activation - make endpoint for toggli…
URL: https://github.com/apache/incubator-pinot/pull/4763#discussion_r341319525
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionResource.java
 ##########
 @@ -540,6 +541,41 @@ public Response createUserAnomaly(
     return Response.ok(anomaly.getId()).build();
   }
 
+  /**
+   * Toggle active/inactive for given detection
+   *
+   * @param detectionId detection config id (must exist)
+   */
+  @PUT
+  @Path("/activation/{id}")
+  @ApiOperation("Make detection active or inactive, given id")
+  public Response toggleActivation(
+      @PathParam("id") long detectionId) throws Exception {
+    Map<String, String> responseMessage = new HashMap<>();
+    Boolean toggledTo = false;
 
 Review comment:
   1. Why use Boolean instead of "boolean"?
   It requires box/unbox.
   2. Default value is false so no need to set explicitly.
   3. This is only a temporarily used variable. Declare a variable to its 
minimum scope.  
   No need to declare  before  the "try" block.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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