Skip to content

Commit 787e72c

Browse files
committed
Avoid using reflection Log object
Change-Id: I801f048afc6f683f7519b0cbf1c99e2268500c45
1 parent 02a041a commit 787e72c

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,14 @@ private[hive] class SparkSQLCLIService(hiveServer: HiveServer2, sqlContext: SQLC
6363
// Try creating spnego UGI if it is configured.
6464
val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL)
6565
val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB)
66-
if (principal.isEmpty || keyTabFile.isEmpty) {
67-
getAncestorField[Log](this, 3, "LOG").info(
68-
s"SPNego httpUGI not created, spNegoPrincipal: $principal , ketabFile: $keyTabFile")
69-
} else {
66+
if (principal.nonEmpty && keyTabFile.nonEmpty) {
7067
try {
7168
httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf)
7269
setSuperField(this, "httpUGI", httpUGI)
73-
getAncestorField[Log](this, 3, "LOG").info("SPNego httpUGI successfully created.")
7470
} catch {
7571
case e: IOException =>
76-
getAncestorField[Log](this, 3, "LOG").warn(s"SPNego httpUGI creation failed: $e")
72+
throw new ServiceException("Unable to login to spnego with given principal/keytab " +
73+
s"$principal/$keyTabFile", e)
7774
}
7875
}
7976
}

0 commit comments

Comments
 (0)