You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ak...@apache.org on 2019/01/23 23:01:02 UTC

[incubator-pinot] branch master updated: [TE] Add Path to the Migration endpoints (#3735)

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

akshayrai09 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 d1fa0e1  [TE] Add Path to the Migration endpoints (#3735)
d1fa0e1 is described below

commit d1fa0e13b5c0b9e818f8ba22ca73c6ec2b086a73
Author: Akshay Rai <ak...@gmail.com>
AuthorDate: Wed Jan 23 15:00:56 2019 -0800

    [TE] Add Path to the Migration endpoints (#3735)
---
 .../dashboard/views/heatmap/HeatMapViewHandler.java         |  2 +-
 .../thirdeye/detection/DetectionMigrationResource.java      | 13 +++++++++----
 .../detection/annotation/registry/DetectionRegistry.java    |  1 -
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/views/heatmap/HeatMapViewHandler.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/views/heatmap/HeatMapViewHandler.java
index 42bc3fb..9a923b3 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/views/heatmap/HeatMapViewHandler.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/views/heatmap/HeatMapViewHandler.java
@@ -19,6 +19,7 @@
 
 package org.apache.pinot.thirdeye.dashboard.views.heatmap;
 
+import com.google.common.collect.Lists;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -52,7 +53,6 @@ import org.apache.pinot.thirdeye.datasource.comparison.TimeOnTimeComparisonReque
 import org.apache.pinot.thirdeye.datasource.comparison.TimeOnTimeComparisonResponse;
 import org.apache.pinot.thirdeye.datasource.comparison.Row.Metric;
 
-import jersey.repackaged.com.google.common.collect.Lists;
 
 public class HeatMapViewHandler implements ViewHandler<HeatMapViewRequest, HeatMapViewResponse> {
 
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionMigrationResource.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionMigrationResource.java
index 7c2c329..267bcd7 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionMigrationResource.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/DetectionMigrationResource.java
@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 import org.apache.commons.lang.exception.ExceptionUtils;
@@ -396,7 +397,8 @@ public class DetectionMigrationResource {
   }
 
   @GET
-  public Response getYamlFromLegacyAnomalyFunction(long anomalyFunctionID) throws Exception {
+  @Path("/legacy-anomaly-function-to-yaml/{id}")
+  public Response getYamlFromLegacyAnomalyFunction(@PathParam("id") long anomalyFunctionID) throws Exception {
     AnomalyFunctionDTO anomalyFunctionDTO = this.anomalyFunctionDAO.findById(anomalyFunctionID);
     if (anomalyFunctionDTO == null) {
       return Response.status(Response.Status.BAD_REQUEST)
@@ -407,7 +409,8 @@ public class DetectionMigrationResource {
   }
 
   @GET
-  public Response getYamlFromLegacyAlert(long alertId) throws Exception {
+  @Path("/legacy-alert-to-yaml/{id}")
+  public Response getYamlFromLegacyAlert(@PathParam("id") long alertId) throws Exception {
     AlertConfigDTO alertConfigDTO = this.alertConfigDAO.findById(alertId);
     if (alertConfigDTO == null) {
       return Response.status(Response.Status.BAD_REQUEST)
@@ -418,7 +421,8 @@ public class DetectionMigrationResource {
   }
 
   @POST
-  public Response migrateApplication(@QueryParam("id") String application) throws Exception {
+  @Path("/application/{name}")
+  public Response migrateApplication(@PathParam("name") String application) throws Exception {
     List<AlertConfigDTO> alertConfigDTOList = alertConfigDAO.findByPredicate(Predicate.EQ("application", application));
     Map<String, String> responseMessage = new HashMap<>();
 
@@ -472,7 +476,8 @@ public class DetectionMigrationResource {
   }
 
   @POST
-  public Response migrateAnomalyFunction(@QueryParam("id") long anomalyFunctionId) throws Exception {
+  @Path("/anomaly-function/{id}")
+  public Response migrateAnomalyFunction(@PathParam("id") long anomalyFunctionId) throws Exception {
     return Response.ok(migrateLegacyAnomalyFunction(anomalyFunctionId)).build();
   }
 }
diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/annotation/registry/DetectionRegistry.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/annotation/registry/DetectionRegistry.java
index 705e6cd..8890ddd 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/annotation/registry/DetectionRegistry.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/annotation/registry/DetectionRegistry.java
@@ -33,7 +33,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.apache.commons.collections.MapUtils;
-import org.junit.Assert;
 import org.reflections.Reflections;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;


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