in thriftserver/server/src/main/scala/org/apache/livy/thriftserver/LivyThriftServer.scala [41:79]
def start(
livyConf: LivyConf,
livySessionManager: InteractiveSessionManager,
sessionStore: SessionStore,
accessManager: AccessManager): Unit = synchronized {
if (thriftServerThread == null) {
info("Starting LivyThriftServer")
val ugi = UserGroupInformation.getCurrentUser
val runThriftServer = new Runnable {
override def run(): Unit = {
try {
thriftServer = new LivyThriftServer(
livyConf,
livySessionManager,
sessionStore,
accessManager)
if (UserGroupInformation.isSecurityEnabled) {
ugi.doAs(new PrivilegedExceptionAction[Unit] {
override def run(): Unit = {
doStart(livyConf)
}
})
} else {
doStart(livyConf)
}
info("LivyThriftServer started")
} catch {
case e: Exception =>
error("Error starting LivyThriftServer", e)
}
}
}
thriftServerThread =
new Thread(new ThreadGroup("thriftserver"), runThriftServer, "Livy-Thriftserver")
thriftServerThread.start()
} else {
error("Livy Thriftserver is already started")
}
}