Skip to content

Commit 2585119

Browse files
author
Marcelo Vanzin
committed
Review feedback.
1 parent 8b97544 commit 2585119

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
238238
private def compareAppInfo(
239239
i1: FsApplicationHistoryInfo,
240240
i2: FsApplicationHistoryInfo): Boolean = {
241-
i1.endTime >= i2.endTime && i1.startTime >= i2.startTime
241+
if (i1.endTime != i2.endTime) i1.endTime >= i2.endTime else i1.startTime >= i2.startTime
242242
}
243243

244244
/**

core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
5151
// Write a new-style application log.
5252
val logFile1 = new File(testDir, "new1")
5353
writeFile(logFile1, true, None,
54-
SparkListenerApplicationStart("app1-1", None, 1L, "test"),
55-
SparkListenerApplicationEnd(2L)
54+
SparkListenerApplicationStart("app1-1", None, 2L, "test"),
55+
SparkListenerApplicationEnd(3L)
5656
)
5757

5858
// Write an unfinished app, new-style.
@@ -66,8 +66,8 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
6666
oldLog.mkdir()
6767
createEmptyFile(new File(oldLog, provider.SPARK_VERSION_PREFIX + "1.0"))
6868
writeFile(new File(oldLog, provider.LOG_PREFIX + "1"), false, None,
69-
SparkListenerApplicationStart("app3", None, 2L, "test"),
70-
SparkListenerApplicationEnd(3L)
69+
SparkListenerApplicationStart("app3", None, 1L, "test"),
70+
SparkListenerApplicationEnd(4L)
7171
)
7272
createEmptyFile(new File(oldLog, provider.APPLICATION_COMPLETE))
7373

@@ -182,9 +182,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
182182
}
183183

184184
test("SPARK-5582: empty log directory") {
185-
val conf = new SparkConf()
186-
.set("spark.history.fs.logDirectory", testDir.getAbsolutePath())
187-
val provider = new FsHistoryProvider(conf)
185+
val provider = new FsHistoryProvider(createTestConf())
188186

189187
val logFile1 = new File(testDir, "app1" + EventLoggingListener.IN_PROGRESS)
190188
writeFile(logFile1, true, None,

0 commit comments

Comments
 (0)