Addendum patch for HADOOP-9652 to fix performance problems. Contributed by Andrew Wang

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1561038 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2014-01-24 15:45:28 +00:00
parent 817be26c17
commit 20176840f6
3 changed files with 18 additions and 4 deletions

View File

@ -424,6 +424,9 @@ Release 2.4.0 - UNRELEASED
HADOOP-10143 replace WritableFactories's hashmap with ConcurrentHashMap HADOOP-10143 replace WritableFactories's hashmap with ConcurrentHashMap
(Liang Xie via stack) (Liang Xie via stack)
HADOOP-9652. Allow RawLocalFs#getFileLinkStatus to fill in the link owner
and mode if requested. (Andrew Wang via Colin Patrick McCabe)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn) HADOOP-9748. Reduce blocking on UGI.ensureInitialized (daryn)
@ -450,9 +453,6 @@ Release 2.4.0 - UNRELEASED
HADOOP-9817. FileSystem#globStatus and FileContext#globStatus need to work HADOOP-9817. FileSystem#globStatus and FileContext#globStatus need to work
with symlinks. (Colin Patrick McCabe via Andrew Wang) 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 HADOOP-9875. TestDoAsEffectiveUser can fail on JDK 7. (Aaron T. Myers via
Colin Patrick McCabe) Colin Patrick McCabe)

View File

@ -16,8 +16,11 @@
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.fs; package org.apache.hadoop.fs;
import com.google.common.annotations.VisibleForTesting;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.File; import java.io.File;
@ -51,7 +54,13 @@ import org.apache.hadoop.util.StringUtils;
public class RawLocalFileSystem extends FileSystem { public class RawLocalFileSystem extends FileSystem {
static final URI NAME = URI.create("file:///"); static final URI NAME = URI.create("file:///");
private Path workingDir; 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() { public RawLocalFileSystem() {
workingDir = getInitialWorkingDirectory(); workingDir = getInitialWorkingDirectory();

View File

@ -39,6 +39,11 @@ import org.junit.Test;
*/ */
abstract public class TestSymlinkLocalFS extends SymlinkBaseTest { abstract public class TestSymlinkLocalFS extends SymlinkBaseTest {
// Workaround for HADOOP-9652
static {
RawLocalFileSystem.useStatIfAvailable();
}
@Override @Override
protected String getScheme() { protected String getScheme() {
return "file"; return "file";