|
@@ -127,30 +127,29 @@ class ScalatraBootstrap extends LifeCycle with Logging {
|
|
|
var batchManager: SessionManager[BatchSession] = null
|
|
var batchManager: SessionManager[BatchSession] = null
|
|
|
|
|
|
|
|
override def init(context: ServletContext): Unit = {
|
|
override def init(context: ServletContext): Unit = {
|
|
|
- val livyConf = new LivyConf()
|
|
|
|
|
-
|
|
|
|
|
- val sessionFactoryKind = try {
|
|
|
|
|
- livyConf.sessionKind()
|
|
|
|
|
- } catch {
|
|
|
|
|
- case e: IllegalStateException =>
|
|
|
|
|
- println(f"Unknown session factory: $e}")
|
|
|
|
|
- sys.exit(1)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ val livyConf = new LivyConf()
|
|
|
|
|
+ val sessionFactoryKind = livyConf.sessionKind()
|
|
|
|
|
|
|
|
- info(f"Using $sessionFactoryKind sessions")
|
|
|
|
|
|
|
+ info(f"Using $sessionFactoryKind sessions")
|
|
|
|
|
|
|
|
- val (sessionFactory, batchFactory) = sessionFactoryKind match {
|
|
|
|
|
- case LivyConf.Process() =>
|
|
|
|
|
- (new InteractiveSessionProcessFactory(livyConf), new BatchSessionProcessFactory(livyConf))
|
|
|
|
|
- case LivyConf.Yarn() =>
|
|
|
|
|
- (new InteractiveSessionYarnFactory(livyConf), new BatchSessionYarnFactory(livyConf))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ val (sessionFactory, batchFactory) = sessionFactoryKind match {
|
|
|
|
|
+ case LivyConf.Process() =>
|
|
|
|
|
+ (new InteractiveSessionProcessFactory(livyConf), new BatchSessionProcessFactory(livyConf))
|
|
|
|
|
+ case LivyConf.Yarn() =>
|
|
|
|
|
+ (new InteractiveSessionYarnFactory(livyConf), new BatchSessionYarnFactory(livyConf))
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- sessionManager = new SessionManager(sessionFactory)
|
|
|
|
|
- batchManager = new SessionManager(batchFactory)
|
|
|
|
|
|
|
+ sessionManager = new SessionManager(sessionFactory)
|
|
|
|
|
+ batchManager = new SessionManager(batchFactory)
|
|
|
|
|
|
|
|
- context.mount(new InteractiveSessionServlet(sessionManager), "/sessions/*")
|
|
|
|
|
- context.mount(new BatchSessionServlet(batchManager), "/batches/*")
|
|
|
|
|
|
|
+ context.mount(new InteractiveSessionServlet(sessionManager), "/sessions/*")
|
|
|
|
|
+ context.mount(new BatchSessionServlet(batchManager), "/batches/*")
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ case e: Throwable =>
|
|
|
|
|
+ println(f"Exception thrown when initializing server: $e")
|
|
|
|
|
+ sys.exit(1)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override def destroy(context: ServletContext): Unit = {
|
|
override def destroy(context: ServletContext): Unit = {
|