jihoonson commented on a change in pull request #10543:
URL: https://github.com/apache/druid/pull/10543#discussion_r534441893



##########
File path: 
server/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java
##########
@@ -88,6 +92,7 @@
   private static final String OBJECTMAPPER_ATTRIBUTE = 
"org.apache.druid.proxy.objectMapper";
 
   private static final int CANCELLATION_TIMEOUT_MILLIS = 500;
+  private static final long serialVersionUID = 2026655693637894524L;

Review comment:
       What is this variable for?

##########
File path: 
server/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java
##########
@@ -449,6 +463,95 @@ static String getAvaticaConnectionId(Map<String, Object> 
requestMap)
     return (String) connectionIdObj;
   }
 
+  static String getAvaticaProtobufConnectionId(Service.Request request)
+  {
+    if (request instanceof Service.CatalogsRequest) {

Review comment:
       These `if` clause seems fragile from changes on Avatica request types 
(such as new request type), but I'm not sure if there is a better way..

##########
File path: 
sql/src/main/java/org/apache/druid/sql/avatica/DruidAvaticaProtobufHandler.java
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.sql.avatica;
+
+import com.google.inject.Inject;
+import org.apache.calcite.avatica.remote.LocalService;
+import org.apache.calcite.avatica.remote.Service;
+import org.apache.calcite.avatica.server.AvaticaProtobufHandler;
+import org.apache.druid.guice.annotations.Self;
+import org.apache.druid.server.DruidNode;
+import org.eclipse.jetty.server.Request;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class DruidAvaticaProtobufHandler extends AvaticaProtobufHandler
+{
+  public static final String AVATICA_PATH = "/druid/v2/sql/avatica-pb/";

Review comment:
       I'm wondering if we can use the same path for both Avatica and Json, but 
accept a query parameter to choose one of them. I think it could be better in 
terms of maintenance. In `AsyncQueryForwardingServlet`, it seems that you can 
check the query string. In `DruidAvaticaHandler`, it can have two delegates for 
JSON and protobuf and calls one of them based on query string in the request.

##########
File path: 
server/src/main/java/org/apache/druid/server/AsyncQueryForwardingServlet.java
##########
@@ -119,6 +124,7 @@ private static void handleException(HttpServletResponse 
response, ObjectMapper o
   private final RequestLogger requestLogger;
   private final GenericQueryMetricsFactory queryMetricsFactory;
   private final AuthenticatorMapper authenticatorMapper;
+  private final transient ProtobufTranslation protobufTranslation;

Review comment:
       What is `transient` keyword for?




----------------------------------------------------------------
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]



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

Reply via email to