From 2dcf4119c416661d2fcc6dcfa60a8926bc9a3318 Mon Sep 17 00:00:00 2001 From: Jiaqi Liu <2257440489@qq.com> Date: Fri, 21 Jul 2017 16:38:45 -0700 Subject: [PATCH] Have Table Endpoint Filter Using Dimensions, Metrics, and Filters to Display Availability --- .../web/endpoints/TablesServlet.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/TablesServlet.java b/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/TablesServlet.java index 8f6fe986ae..2e2999a961 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/TablesServlet.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/TablesServlet.java @@ -32,6 +32,7 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedHashSet; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -51,6 +52,7 @@ import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.PathSegment; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; @@ -256,6 +258,40 @@ public Response getTableByGrain( } } + @GET + @Timed + @Produces(MediaType.APPLICATION_JSON) + @Path("/{tableName}/{granularity}/{dimensions:.*}") + public void getTableAvailability( + @PathParam("tableName") String tableName, + @PathParam("granularity") String granularity, + @PathParam("dimensions") List dimensions, + @QueryParam("metrics") String metrics, + @QueryParam("dateTime") String intervals, + @QueryParam("filters") String filters, + @Context UriInfo uriInfo, + @Context final ContainerRequestContext containerRequestContext + ) { + RequestLog.startTiming(this); + RequestLog.record(new TableRequest(tableName, granularity)); + + TablesApiRequest tablesApiRequest = new TablesApiRequest( + tableName, + granularity, + null, + "", + "", + uriInfo, + this, + dimensions, + metrics, + intervals, + filters, + null + ); + } + + /** * Get all the tables full view. *