From 3e46b3534a6bd63136f59cabcf40150e4f209977 Mon Sep 17 00:00:00 2001 From: Carson Wang Date: Mon, 15 Jun 2015 17:07:21 +0800 Subject: [PATCH] Update code style --- .../apache/spark/deploy/history/FsHistoryProvider.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala b/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala index bbb2d0f0e9e18..58e490df74c6f 100644 --- a/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala +++ b/core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala @@ -282,11 +282,9 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock) val newAttempts = logs.flatMap { fileStatus => try { val res = replay(fileStatus, bus) - res.map { r => - logInfo(s"Application log ${r.logPath} loaded successfully.") - }.getOrElse { - logInfo( - s"Failed to load application log ${fileStatus.getPath}." + + res match { + case Some(r) => logInfo(s"Application log ${r.logPath} loaded successfully.") + case None => logWarning(s"Failed to load application log ${fileStatus.getPath}." + "The application may have not started.") } res