steveloughran commented on a change in pull request #27042: [SPARK-30382]
start-thriftserver --help throws ClassNotFoundException
URL: https://github.com/apache/spark/pull/27042#discussion_r362443083
##########
File path:
sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/server/HiveServer2.java
##########
@@ -158,25 +156,16 @@ private static void startHiveServer2() throws Throwable {
public static void main(String[] args) {
HiveConf.setLoadHiveServer2Config(true);
- try {
- ServerOptionsProcessor oproc = new ServerOptionsProcessor("hiveserver2");
- ServerOptionsProcessorResponse oprocResponse = oproc.parse(args);
+ ServerOptionsProcessor oproc = new ServerOptionsProcessor("hiveserver2");
+ ServerOptionsProcessorResponse oprocResponse = oproc.parse(args);
- // NOTE: It is critical to do this here so that log4j is reinitialized
- // before any of the other core hive classes are loaded
- String initLog4jMessage = LogUtils.initHiveLog4j();
- LOG.debug(initLog4jMessage);
- HiveStringUtils.startupShutdownMessage(HiveServer2.class, args, LOG);
+ HiveStringUtils.startupShutdownMessage(HiveServer2.class, args, LOG);
- // Log debug message from "oproc" after log4j initialize properly
- LOG.debug(oproc.getDebugMessage().toString());
+ // Log debug message from "oproc" after log4j initialize properly
+ LOG.debug(oproc.getDebugMessage().toString());
Review comment:
the toString() could trigger exceptions (NPE etc) If you aren't careful and
there is the extra cost of that operation. Its why scala string expansion and
SLF4J {} entries are better
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]