hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sj...@apache.org
Subject hadoop git commit: HADOOP-12810. FileSystem#listLocatedStatus causes unnecessary RPC calls (Contributed by Ryan Blue)
Date Tue, 13 Sep 2016 23:23:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 e6856d66e -> a5424e2a1


HADOOP-12810. FileSystem#listLocatedStatus causes unnecessary RPC calls (Contributed by Ryan
Blue)

(cherry picked from commit 96ea3094315bb1e1a5e268e3817c7fdedc3e9462)
(cherry picked from commit 2bf5a005fab287689a148c1928f3b04c0a8dcedf)
(cherry picked from commit a9c1bb42418dbde8958dbbc115f6045e696ea2ea)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a5424e2a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a5424e2a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a5424e2a

Branch: refs/heads/branch-2.6
Commit: a5424e2a1034c7c76408137a9bac4c30acd85a75
Parents: e6856d6
Author: Vinayakumar B <vinayakumarb@apache.org>
Authored: Wed Feb 17 10:13:41 2016 +0530
Committer: Sangjin Lee <sjlee@apache.org>
Committed: Tue Sep 13 16:22:11 2016 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                  | 3 +++
 .../src/main/java/org/apache/hadoop/fs/FileSystem.java           | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a5424e2a/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index e85f27e..8b0d525 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -22,6 +22,9 @@ Release 2.6.5 - UNRELEASED
 
   OPTIMIZATIONS
 
+    HADOOP-12810. FileSystem#listLocatedStatus causes unnecessary RPC calls
+    (Ryan Blue via vinayakumarb)
+
   BUG FIXES
 
     HADOOP-12773. HBase classes fail to load with client/job classloader

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a5424e2a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
index ffee0fd..62c47e1 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java
@@ -1693,8 +1693,10 @@ public abstract class FileSystem extends Configured implements Closeable
{
           throw new NoSuchElementException("No more entry in " + f);
         }
         FileStatus result = stats[i++];
+        // for files, use getBlockLocations(FileStatus, int, int) to avoid
+        // calling getFileStatus(Path) to load the FileStatus again
         BlockLocation[] locs = result.isFile() ?
-            getFileBlockLocations(result.getPath(), 0, result.getLen()) :
+            getFileBlockLocations(result, 0, result.getLen()) :
             null;
         return new LocatedFileStatus(result, locs);
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message