difin commented on code in PR #5652:
URL: https://github.com/apache/hive/pull/5652#discussion_r2015054113
##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -534,6 +455,102 @@ 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);
+ builder.setConf(hiveConf);
Review Comment:
This was an existing code.
"hiveconf" was used in HS2Peers servlet. I refactored it to use
`HttpServer.CONF_CONTEXT_ATTRIBUTE` that is set by `HttpServer.Builder`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]