Skip to content

Commit c6a3c0d

Browse files
srowenJoshRosen
authored andcommitted
SPARK-4910 [CORE] build failed (use of FileStatus.isFile in Hadoop 1.x)
Fix small Hadoop 1 compile error from SPARK-2261. In Hadoop 1.x, all we have is FileStatus.isDir, so these "is file" assertions are changed to "is not a dir". This is how similar checks are done so far in the code base. Author: Sean Owen <[email protected]> Closes #3754 from srowen/SPARK-4910 and squashes the following commits: 52c5e4e [Sean Owen] Fix small Hadoop 1 compile error from SPARK-2261
1 parent a764960 commit c6a3c0d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin
6565
val logPath = new Path(eventLogger.logPath + EventLoggingListener.IN_PROGRESS)
6666
assert(fileSystem.exists(logPath))
6767
val logStatus = fileSystem.getFileStatus(logPath)
68-
assert(logStatus.isFile)
68+
assert(!logStatus.isDir)
6969

7070
// Verify log is renamed after stop()
7171
eventLogger.stop()
72-
assert(fileSystem.getFileStatus(new Path(eventLogger.logPath)).isFile())
72+
assert(!fileSystem.getFileStatus(new Path(eventLogger.logPath)).isDir)
7373
}
7474

7575
test("Basic event logging") {

core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ReplayListenerSuite extends FunSuite with BeforeAndAfter {
112112
val applications = fileSystem.listStatus(logDirPath)
113113
assert(applications != null && applications.size > 0)
114114
val eventLog = applications.sortBy(_.getModificationTime).last
115-
assert(eventLog.isFile)
115+
assert(!eventLog.isDir)
116116

117117
// Replay events
118118
val (logData, version) = EventLoggingListener.openEventLog(eventLog.getPath(), fileSystem)

0 commit comments

Comments
 (0)