Skip to content

SPARK-4910 [CORE] build failed (use of FileStatus.isFile in Hadoop 1.x) #3754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

srowen
Copy link
Member

@srowen srowen commented Dec 21, 2014

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.

@SparkQA
Copy link

SparkQA commented Dec 21, 2014

Test build #24682 has started for PR 3754 at commit 52c5e4e.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 21, 2014

Test build #24682 has finished for PR 3754 at commit 52c5e4e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24682/
Test PASSed.

@JoshRosen
Copy link
Contributor

This seems fine to me, especially since this only affects test code. I guess that newer versions of Hadoop have isSymlink, so it may not always be the case that !isDir implies isFile. That said, it looks like this may be the best that we can do in Hadoop 1.x (see Javadoc), so I'm fine with merging this.

One minor comment, though: it looks like your PR description / commit message describes the opposite of this change:

In Hadoop 1.x, all we have is FileStatus.isFile, so these "is directory" assertions are changed to "is not a file"

but I think you meant to say

In Hadoop 1.x, all we have is FileStatus.isDir, so these "is file" assertions are changed to "is not a directory"

@srowen
Copy link
Member Author

srowen commented Dec 21, 2014

@JoshRosen Yes I agree, isDir is not quite the same as !isFile but it's the closest thing available in 1.x. I'll fix the message above, oops.

@JoshRosen
Copy link
Contributor

According to HADOOP-6585, the old behavior / usage was that !isDir implies isFile. Symlinks broke this, but we don't use them in these tests.

I'm going to merge this into master to fix the Hadoop 1 builds. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants