hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yjzhan...@apache.org
Subject hadoop git commit: HDFS-11689. New exception thrown by DFSClient%isHDFSEncryptionEnabled broke hacky hive code. Contributed by Yongjun Zhang.
Date Fri, 21 Apr 2017 21:07:52 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 3b7bb7b94 -> 31d7d4707


HDFS-11689. New exception thrown by DFSClient%isHDFSEncryptionEnabled broke hacky hive code.
Contributed by Yongjun Zhang.

(cherry picked from commit 5078df7be317e635615c05c5da3285798993ff1f)


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

Branch: refs/heads/branch-2
Commit: 31d7d470709555cbee14f0fdf59b9e15c3c02ff1
Parents: 3b7bb7b
Author: Yongjun Zhang <yzhang@cloudera.com>
Authored: Fri Apr 21 13:36:31 2017 -0700
Committer: Yongjun Zhang <yzhang@cloudera.com>
Committed: Fri Apr 21 14:01:47 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hdfs/DFSClient.java    | 18 ++++++++++++++++--
 .../apache/hadoop/hdfs/DistributedFileSystem.java |  8 +-------
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/31d7d470/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index ca82df8..07f5e78 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -3067,10 +3067,24 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
 
   /**
    * Probe for encryption enabled on this filesystem.
+   * Note (see HDFS-11689):
+   * Not to throw exception in this method since it would break hive.
+   * Hive accesses this method and assumes no exception would be thrown.
+   * Hive should not access DFSClient since it is InterfaceAudience.Private.
+   * Deprecated annotation is added to trigger build warning at hive side.
+   * Request has been made to Hive to remove access to DFSClient.
    * @return true if encryption is enabled
    */
-  public boolean isHDFSEncryptionEnabled() throws IOException{
-    return getKeyProviderUri() != null;
+  @Deprecated
+  public boolean isHDFSEncryptionEnabled() {
+    boolean result = false;
+    try {
+      result = (getKeyProviderUri() != null);
+    } catch (IOException ioe) {
+      DFSClient.LOG.warn("Exception while checking whether encryption zone "
+            + "is supported, assumes it is not supported", ioe);
+    }
+    return result;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/31d7d470/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
index 4caf04f..fd45406 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
@@ -2520,13 +2520,7 @@ public class DistributedFileSystem extends FileSystem {
    */
   @Override
   public Path getTrashRoot(Path path) {
-    try {
-      if ((path == null) || !dfs.isHDFSEncryptionEnabled()) {
-        return super.getTrashRoot(path);
-      }
-    } catch (IOException ioe) {
-      DFSClient.LOG.warn("Exception while checking whether encryption zone is "
-          + "supported", ioe);
+    if ((path == null) || !dfs.isHDFSEncryptionEnabled()) {
       return super.getTrashRoot(path);
     }
 


---------------------------------------------------------------------
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