deniskuzZ commented on code in PR #5652:
URL: https://github.com/apache/hive/pull/5652#discussion_r2009190098


##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -534,6 +455,101 @@ public synchronized void init(HiveConf hiveConf) {
     // Extra time for releasing the resources if timeout sets to 0
     ShutdownHookManager.addGracefulShutDownHook(() -> graceful_stop(),  
timeout == 0 ? 30 : timeout);
   }
+  
+  private void addHAContextAttributes(HttpServer.Builder builder, HiveConf 
hiveConf) {
+    builder.setContextAttribute("hs2.isLeader", isLeader);
+    builder.setContextAttribute("hs2.failover.callback", new 
FailoverHandlerCallback(hs2HARegistry));
+    builder.setContextAttribute("hiveconf", hiveConf);
+  }
+  
+  private HttpServer.Builder initBuilder(String webHost, int port, String 
name, String contextPath, HiveConf hiveConf) throws IOException {
+    HttpServer.Builder builder = new HttpServer.Builder(name);
+    builder.setPort(port).setConf(hiveConf);

Review Comment:
   can we separate the `port` and `hiveConf` setup?



##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -534,6 +455,101 @@ public synchronized void init(HiveConf hiveConf) {
     // Extra time for releasing the resources if timeout sets to 0
     ShutdownHookManager.addGracefulShutDownHook(() -> graceful_stop(),  
timeout == 0 ? 30 : timeout);
   }
+  
+  private void addHAContextAttributes(HttpServer.Builder builder, HiveConf 
hiveConf) {
+    builder.setContextAttribute("hs2.isLeader", isLeader);
+    builder.setContextAttribute("hs2.failover.callback", new 
FailoverHandlerCallback(hs2HARegistry));
+    builder.setContextAttribute("hiveconf", hiveConf);
+  }
+  
+  private HttpServer.Builder initBuilder(String webHost, int port, String 
name, String contextPath, HiveConf hiveConf) throws IOException {
+    HttpServer.Builder builder = new HttpServer.Builder(name);
+    builder.setPort(port).setConf(hiveConf);

Review Comment:
   can we split the `port` and `hiveConf` setup?



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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to