Skip to content

Commit

Permalink
Update the codes
Browse files Browse the repository at this point in the history
Change-Id: I24256600ba0c2c4367ea92f8e9f8952251a93dda
  • Loading branch information
jerryshao committed Dec 26, 2016
1 parent c1d9c22 commit c28ac8c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ class InteractiveSession(
_appId = appIdHint
sessionStore.save(RECOVERY_SESSION_TYPE, recoveryMetadata)
heartbeat()
// Register this class to RSCClient as a session state listener
client.foreach(_.registerStateListener(this))

private val app = mockApp.orElse {
if (livyConf.isRunningOnYarn()) {
Expand Down Expand Up @@ -403,9 +405,6 @@ class InteractiveSession(
}
uriFuture onFailure { case e => warn("Fail to get rsc uri", e) }

// Register this class to RSCClient as a session state listener
client.get.registerStateListener(this)

// Send a dummy job that will return once the client is ready to be used, and set the
// state to "idle" at that point.
client.get.submit(new PingJob()).addListener(new JobHandle.Listener[Void]() {
Expand Down Expand Up @@ -557,7 +556,7 @@ class InteractiveSession(

private def ensureRunning(): Unit = synchronized {
_state match {
case SessionState.Running() | SessionState.Idle() | SessionState.Busy() => Unit
case SessionState.Idle() | SessionState.Busy() => Unit
case _ =>
throw new IllegalStateException(s"Session is in state ${_state}")
}
Expand Down

0 comments on commit c28ac8c

Please sign in to comment.