Skip to content

Commit

Permalink
[SPARK-1860] Using more string interpolation. Better error logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mccheah committed Oct 3, 2014
1 parent 802473e commit 87b5d03
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ private[spark] class Worker(
changeMaster(masterUrl, masterWebUiUrl)
context.system.scheduler.schedule(0 millis, HEARTBEAT_MILLIS millis, self, SendHeartbeat)
if (CLEANUP_ENABLED) {
logInfo("Worker cleanup is enabled, so old application directories will be deleted"
+ " in: " + workDir)
logInfo(s"Worker cleanup enabled; old application directories will be deleted in: $workDir")
context.system.scheduler.schedule(CLEANUP_INTERVAL_MILLIS millis,
CLEANUP_INTERVAL_MILLIS millis, self, WorkDirCleanup)
}
Expand All @@ -218,7 +217,7 @@ private[spark] class Worker(
dir.isDirectory && !isAppStillRunning &&
!Utils.doesDirectoryContainAnyNewFiles(dir, APP_DATA_RETENTION_SECS)
}.foreach { dir =>
logInfo("Removing directory: %s".format(dir.getPath))
logInfo(s"Removing directory: ${dir.getPath}")
Utils.deleteRecursively(dir)
}
}
Expand Down Expand Up @@ -267,13 +266,13 @@ private[spark] class Worker(
master ! ExecutorStateChanged(appId, execId, manager.state, None, None)
} catch {
case e: Exception => {
logError("Failed to launch executor %s/%d for %s. Caused by exception: %s"
.format(appId, execId, appDesc.name, e.toString))
logError(s"Failed to launch executor $appId/$execId for ${appDesc.name}.", e)
if (executors.contains(appId + "/" + execId)) {
executors(appId + "/" + execId).kill()
executors -= appId + "/" + execId
}
master ! ExecutorStateChanged(appId, execId, ExecutorState.FAILED, None, None)
master ! ExecutorStateChanged(appId, execId, ExecutorState.FAILED,
Some(e.toString), None)
}
}
}
Expand Down

0 comments on commit 87b5d03

Please sign in to comment.