diff options
author | Sean Owen <sowen@cloudera.com> | 2014-12-21 13:16:57 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2014-12-21 13:16:57 -0800 |
commit | c6a3c0d5052e5bf6f981e5f91e05cba38b707237 (patch) | |
tree | 077eacd1cca080325c82ef9f3dbcaee394d9b3d1 | |
parent | a764960b3b6d842eef7fa4777c8fa99d3f60fa1e (diff) | |
download | spark-c6a3c0d5052e5bf6f981e5f91e05cba38b707237.tar.gz spark-c6a3c0d5052e5bf6f981e5f91e05cba38b707237.tar.bz2 spark-c6a3c0d5052e5bf6f981e5f91e05cba38b707237.zip |
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
-rw-r--r-- | core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala | 4 | ||||
-rw-r--r-- | core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala index 5909811c20..1de7e13003 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala @@ -65,11 +65,11 @@ class EventLoggingListenerSuite extends FunSuite with BeforeAndAfter with Loggin val logPath = new Path(eventLogger.logPath + EventLoggingListener.IN_PROGRESS) assert(fileSystem.exists(logPath)) val logStatus = fileSystem.getFileStatus(logPath) - assert(logStatus.isFile) + assert(!logStatus.isDir) // Verify log is renamed after stop() eventLogger.stop() - assert(fileSystem.getFileStatus(new Path(eventLogger.logPath)).isFile()) + assert(!fileSystem.getFileStatus(new Path(eventLogger.logPath)).isDir) } test("Basic event logging") { diff --git a/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala index 7e635cb061..7e360cc608 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala @@ -112,7 +112,7 @@ class ReplayListenerSuite extends FunSuite with BeforeAndAfter { val applications = fileSystem.listStatus(logDirPath) assert(applications != null && applications.size > 0) val eventLog = applications.sortBy(_.getModificationTime).last - assert(eventLog.isFile) + assert(!eventLog.isDir) // Replay events val (logData, version) = EventLoggingListener.openEventLog(eventLog.getPath(), fileSystem) |