diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index b3e96b9d9de..38a6f039680 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -121,6 +121,9 @@ Release 2.4.0 - UNRELEASED HADOOP-9420. Add percentile or max metric for rpcQueueTime, processing time. (Liang Xie via wang) + HADOOP-9652. Allow RawLocalFs#getFileLinkStatus to fill in the link owner + and mode if requested. (Andrew Wang via Colin Patrick McCabe) + OPTIMIZATIONS HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn) @@ -150,9 +153,6 @@ Release 2.4.0 - UNRELEASED HADOOP-9817. FileSystem#globStatus and FileContext#globStatus need to work with symlinks. (Colin Patrick McCabe via Andrew Wang) - HADOOP-9652. RawLocalFs#getFileLinkStatus does not fill in the link owner - and mode. (Andrew Wang via Colin Patrick McCabe) - HADOOP-9875. TestDoAsEffectiveUser can fail on JDK 7. (Aaron T. Myers via Colin Patrick McCabe) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java index ede8e6556e2..fa4970bff01 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java @@ -16,8 +16,11 @@ * limitations under the License. */ + package org.apache.hadoop.fs; +import com.google.common.annotations.VisibleForTesting; + import java.io.BufferedOutputStream; import java.io.DataOutput; import java.io.File; @@ -51,7 +54,13 @@ import org.apache.hadoop.util.StringUtils; public class RawLocalFileSystem extends FileSystem { static final URI NAME = URI.create("file:///"); private Path workingDir; - private static final boolean useDeprecatedFileStatus = !Stat.isAvailable(); + // Temporary workaround for HADOOP-9652. + private static boolean useDeprecatedFileStatus = true; + + @VisibleForTesting + public static void useStatIfAvailable() { + useDeprecatedFileStatus = !Stat.isAvailable(); + } public RawLocalFileSystem() { workingDir = getInitialWorkingDirectory(); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java index c82dcc8a124..64e34af64bb 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java @@ -38,6 +38,11 @@ import org.junit.Test; * Test symbolic links using LocalFs. */ abstract public class TestSymlinkLocalFS extends SymlinkBaseTest { + + // Workaround for HADOOP-9652 + static { + RawLocalFileSystem.useStatIfAvailable(); + } @Override protected String getScheme() {