You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by li...@apache.org on 2017/05/03 03:54:30 UTC

hive git commit: Revert "HIVE-16047: Shouldn't try to get KeyProvider unless encryption is enabled (Rui reviewed by Xuefu and Ferdinand)"

Repository: hive
Updated Branches:
  refs/heads/master 40b70eb18 -> d03261c47


Revert "HIVE-16047: Shouldn't try to get KeyProvider unless encryption is enabled (Rui reviewed by Xuefu and Ferdinand)"


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

Branch: refs/heads/master
Commit: d03261c473312803a7a0cb0abd1f14d50444887d
Parents: 40b70eb
Author: Rui Li <li...@apache.org>
Authored: Wed May 3 11:54:26 2017 +0800
Committer: Rui Li <li...@apache.org>
Committed: Wed May 3 11:54:26 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/shims/Hadoop23Shims.java | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d03261c4/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
----------------------------------------------------------------------
diff --git a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
index 21a18f8..0483e91 100644
--- a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
+++ b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
@@ -57,7 +57,6 @@ import org.apache.hadoop.fs.TrashPolicy;
 import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.DFSClient;
-import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.MiniDFSNNTopology;
@@ -1149,23 +1148,10 @@ public class Hadoop23Shims extends HadoopShimsSecure {
       DistributedFileSystem dfs = (DistributedFileSystem)FileSystem.get(uri, conf);
 
       this.conf = conf;
-      this.keyProvider = isEncryptionEnabled(dfs.getClient(), dfs.getConf()) ?
-          dfs.getClient().getKeyProvider() : null;
+      this.keyProvider = dfs.getClient().getKeyProvider();
       this.hdfsAdmin = new HdfsAdmin(uri, conf);
     }
 
-    private boolean isEncryptionEnabled(DFSClient client, Configuration conf) {
-      try {
-        DFSClient.class.getMethod("isHDFSEncryptionEnabled");
-      } catch (NoSuchMethodException e) {
-        // The method is available since Hadoop-2.7.1; if we run with an older Hadoop, check this
-        // ourselves. Note that this setting is in turn deprected in newer versions of Hadoop, but
-        // we only care for it in the older versions; so we will hardcode the old name here.
-        return !conf.getTrimmed("dfs.encryption.key.provider.uri", "").isEmpty();
-      }
-      return client.isHDFSEncryptionEnabled();
-    }
-
     @Override
     public boolean isPathEncrypted(Path path) throws IOException {
       Path fullPath;