From 67efdcf1330c45a361c58f1c4659aa0fb390951e Mon Sep 17 00:00:00 2001 From: Ariel Weisberg Date: Wed, 4 Sep 2019 17:44:57 -0400 Subject: [PATCH] Move request slug from path to query This prevents the airlift HTTP server from logging the slug in the http request log. --- .../com/facebook/presto/server/protocol/Query.java | 2 +- .../presto/server/protocol/StatementResource.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/presto-main/src/main/java/com/facebook/presto/server/protocol/Query.java b/presto-main/src/main/java/com/facebook/presto/server/protocol/Query.java index 5c1936cb472a..d8b5efe7c18c 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/protocol/Query.java +++ b/presto-main/src/main/java/com/facebook/presto/server/protocol/Query.java @@ -579,9 +579,9 @@ private synchronized URI createNextResultsUri(String scheme, UriInfo uriInfo) .scheme(scheme) .replacePath("/v1/statement") .path(queryId.toString()) - .path(slug) .path(String.valueOf(resultId.incrementAndGet())) .replaceQuery("") + .queryParam("slug", slug) .build(); } diff --git a/presto-main/src/main/java/com/facebook/presto/server/protocol/StatementResource.java b/presto-main/src/main/java/com/facebook/presto/server/protocol/StatementResource.java index c4c03b88aea0..208dbf7bcaad 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/protocol/StatementResource.java +++ b/presto-main/src/main/java/com/facebook/presto/server/protocol/StatementResource.java @@ -172,12 +172,12 @@ public Response createQuery( } @GET - @Path("{queryId}/{slug}/{token}") + @Path("{queryId}/{token}") @Produces(MediaType.APPLICATION_JSON) public void getQueryResults( @PathParam("queryId") QueryId queryId, - @PathParam("slug") String slug, @PathParam("token") long token, + @QueryParam("slug") String slug, @QueryParam("maxWait") Duration maxWait, @QueryParam("targetResultSize") DataSize targetResultSize, @HeaderParam(X_FORWARDED_PROTO) String proto, @@ -274,12 +274,12 @@ private static Response toResponse(Query query, QueryResults queryResults) } @DELETE - @Path("{queryId}/{slug}/{token}") + @Path("{queryId}/{token}") @Produces(MediaType.APPLICATION_JSON) public Response cancelQuery( @PathParam("queryId") QueryId queryId, - @PathParam("slug") String slug, - @PathParam("token") long token) + @PathParam("token") long token, + @QueryParam("slug") String slug) { Query query = getQuery(queryId, slug); if (query == null) {