hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [35/50] hadoop git commit: HDFS-8368. Erasure Coding: DFS opening a non-existent file need to be handled properly. Contributed by Rakesh R.
Date Tue, 19 May 2015 05:15:39 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/1ff3ad19
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1ff3ad19
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1ff3ad19

Branch: refs/heads/HDFS-7285
Commit: 1ff3ad195f28520db06d64b57e7cddeb684a7110
Parents: 809dfc4
Author: Zhe Zhang <zhz@apache.org>
Authored: Tue May 12 14:31:28 2015 -0700
Committer: Jing Zhao <jing9@apache.org>
Committed: Mon May 18 22:11:10 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/1ff3ad19/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/1ff3ad19/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