Skip to content

Commit

Permalink
YarnClientSchedulerBack.asyncMonitorApplication should be common with
Browse files Browse the repository at this point in the history
Client.monitorApplication
  • Loading branch information
unknown authored and unknown committed Apr 1, 2015
1 parent 305abe1 commit 568f46f
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,14 @@ private[spark] class YarnClientSchedulerBackend(
val t = new Thread {
override def run() {
while (!stopping) {
var state: YarnApplicationState = null
try {
val report = client.getApplicationReport(appId)
state = report.getYarnApplicationState()
} catch {
case e: ApplicationNotFoundException =>
state = YarnApplicationState.KILLED
}
val (state, _) = client.monitorApplication(appId, logApplicationReport = false)
if (state == YarnApplicationState.FINISHED ||
state == YarnApplicationState.KILLED ||
state == YarnApplicationState.FAILED) {
logError(s"Yarn application has already exited with state $state!")
sc.stop()
stopping = true
}
Thread.sleep(1000L)
}
Thread.currentThread().interrupt()
}
Expand Down

0 comments on commit 568f46f

Please sign in to comment.