You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/07/25 18:12:22 UTC

[GitHub] [incubator-pinot] elonazoulay commented on a change in pull request #5717: Add streaming query handler

elonazoulay commented on a change in pull request #5717:
URL: https://github.com/apache/incubator-pinot/pull/5717#discussion_r460429801



##########
File path: pinot-server/src/main/java/org/apache/pinot/server/starter/grpc/PinotQueryService.java
##########
@@ -18,6 +18,57 @@
  */
 package org.apache.pinot.server.starter.grpc;
 
+import io.grpc.Server;
+import io.grpc.ServerBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
 public class PinotQueryService {
+  private static final Logger LOGGER = LoggerFactory.getLogger(PinotQueryService.class);
+
+  private final int port;
+  private final Server server;
+
+  // TODO: pass config, and parameters to initialize handler
+  public PinotQueryService(int port) {
+    this.port = port;
+    server = ServerBuilder.forPort(port)
+        .addService(new PinotQueryHandler())
+        .build();
+
+  }
+
+  /** Start serving requests. */
+  public void start() throws IOException {
+    server.start();
+    LOGGER.info("Server started. Listening on {}", port);
+    Runtime.getRuntime().addShutdownHook(new Thread(() -> {

Review comment:
       Removed, can always add it back if needed.




----------------------------------------------------------------
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:
users@infra.apache.org



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