Skip to content
Snippets Groups Projects
Commit c6a3c0d5 authored by Sean Owen's avatar Sean Owen Committed by Josh Rosen
Browse files

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 <sowen@cloudera.com>

Closes #3754 from srowen/SPARK-4910 and squashes the following commits:

52c5e4e [Sean Owen] Fix small Hadoop 1 compile error from SPARK-2261
parent a764960b
No related branches found
No related tags found
No related merge requests found
...@@ -65,11 +65,11 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin ...@@ -65,11 +65,11 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin
val logPath = new Path(eventLogger.logPath + EventLoggingListener.IN_PROGRESS) val logPath = new Path(eventLogger.logPath + EventLoggingListener.IN_PROGRESS)
assert(fileSystem.exists(logPath)) assert(fileSystem.exists(logPath))
val logStatus = fileSystem.getFileStatus(logPath) val logStatus = fileSystem.getFileStatus(logPath)
assert(logStatus.isFile) assert(!logStatus.isDir)
// Verify log is renamed after stop() // Verify log is renamed after stop()
eventLogger.stop() eventLogger.stop()
assert(fileSystem.getFileStatus(new Path(eventLogger.logPath)).isFile()) assert(!fileSystem.getFileStatus(new Path(eventLogger.logPath)).isDir)
} }
test("Basic event logging") { test("Basic event logging") {
......
...@@ -112,7 +112,7 @@ class ReplayListenerSuite extends FunSuite with BeforeAndAfter { ...@@ -112,7 +112,7 @@ class ReplayListenerSuite extends FunSuite with BeforeAndAfter {
val applications = fileSystem.listStatus(logDirPath) val applications = fileSystem.listStatus(logDirPath)
assert(applications != null && applications.size > 0) assert(applications != null && applications.size > 0)
val eventLog = applications.sortBy(_.getModificationTime).last val eventLog = applications.sortBy(_.getModificationTime).last
assert(eventLog.isFile) assert(!eventLog.isDir)
// Replay events // Replay events
val (logData, version) = EventLoggingListener.openEventLog(eventLog.getPath(), fileSystem) val (logData, version) = EventLoggingListener.openEventLog(eventLog.getPath(), fileSystem)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment