From 42900bd080ef466c4298631bcf0d16414cf101bf Mon Sep 17 00:00:00 2001 From: Uma Maheswara Rao G Date: Sun, 11 Mar 2012 19:23:45 +0000 Subject: [PATCH] HADOOP-7900. LocalDirAllocator confChanged() accesses conf.get() twice. Contributed by Ravi Gummadi. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1299434 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e335bb95f6..d69488eb5f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -54,6 +54,9 @@ Trunk (unreleased changes) BUG FIXES + HADOOP-7900. LocalDirAllocator confChanged() accesses conf.get() twice + (Ravi Gummadi via Uma Maheswara Rao G) + HADOOP-8146. FsShell commands cannot be interrupted (Daryn Sharp via Uma Maheswara Rao G) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java index d1eae086f9..872434bb87 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java @@ -253,7 +253,7 @@ private synchronized void confChanged(Configuration conf) throws IOException { String newLocalDirs = conf.get(contextCfgItemName); if (!newLocalDirs.equals(savedLocalDirs)) { - localDirs = conf.getTrimmedStrings(contextCfgItemName); + localDirs = StringUtils.getTrimmedStrings(newLocalDirs); localFS = FileSystem.getLocal(conf); int numDirs = localDirs.length; ArrayList dirs = new ArrayList(numDirs);