hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [44/50] hadoop git commit: HDFS-8368. Erasure Coding: DFS opening a non-existent file need to be handled properly. Contributed by Rakesh R.
Date Sat, 16 May 2015 23:59:12 GMT
HDFS-8368. Erasure Coding: DFS opening a non-existent file need to be handled properly. Contributed
by Rakesh R.


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

Branch: refs/heads/HDFS-7285
Commit: a5749e5832bc04d84b5bf254afb5573c382391ab
Parents: cd36107
Author: Zhe Zhang <zhz@apache.org>
Authored: Tue May 12 14:31:28 2015 -0700
Committer: Jing Zhao <jing9@apache.org>
Committed: Sat May 16 15:18:22 2015 -0700

----------------------------------------------------------------------
 .../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt                |  3 +++
 .../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 12 +++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a5749e58/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
index f026a5c..79ad208 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
@@ -201,3 +201,6 @@
 
     HDFS-8372. Erasure coding: compute storage type quotas for striped files,
     to be consistent with HDFS-8327. (Zhe Zhang via jing9)
+
+    HDFS-8368. Erasure Coding: DFS opening a non-existent file need to be 
+    handled properly (Rakesh R via zhz)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a5749e58/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index 12c4a4b..cde1fc8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -1191,12 +1191,14 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
     //    Get block info from namenode
     TraceScope scope = getPathTraceScope("newDFSInputStream", src);
     try {
-      ECSchema schema = getFileInfo(src).getECSchema();
-      if (schema != null) {
-        return new DFSStripedInputStream(this, src, verifyChecksum, schema);
-      } else {
-        return new DFSInputStream(this, src, verifyChecksum);
+      HdfsFileStatus fileInfo = getFileInfo(src);
+      if (fileInfo != null) {
+        ECSchema schema = fileInfo.getECSchema();
+        if (schema != null) {
+          return new DFSStripedInputStream(this, src, verifyChecksum, schema);
+        }
       }
+      return new DFSInputStream(this, src, verifyChecksum);
     } finally {
       scope.close();
     }


Mime
View raw message