Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/master/Master.scala
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,19 @@ private[deploy] class Master(
}
}

// Update application state if executors are accepted and RUNNING
apps.foreach(appInfo => {
val app = idToApp(appInfo.id)
apps.foreach(f = appInfo => {
Copy link

@brad-kaiser brad-kaiser Jun 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be more clear to write foreach like this. You don't need the extra parentheses.

apps.foreach { appInfo =>
  ...
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Bad, IDE auto corrected few things. Please review the latest update

val app = idToApp(appInfo.id)
if (app.executors.size > 0 &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be more clear to write this condition like this

if (app.executors.nonEmpty && app.executors.forall(_._2.state == ExecutorState.RUNNING))

app.executors.filter(_._2.state != ExecutorState.RUNNING).isEmpty) {
app.state = ApplicationState.RUNNING
logInfo(s"Application :: ${app.id} status updated to RUNNING state")
}
})
})

state = RecoveryState.ALIVE
schedule()
logInfo("Recovery complete - resuming operations!")
Expand Down