You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/20 20:06:54 UTC

[GitHub] [hive] umamaheswararao commented on a change in pull request #1279: HIVE-16490. Hive should not use getKeyProvider from DFSClient directly.

umamaheswararao commented on a change in pull request #1279:
URL: https://github.com/apache/hive/pull/1279#discussion_r457661391



##########
File path: shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
##########
@@ -1223,11 +1223,31 @@ public static boolean isHdfsEncryptionSupported() {
     private final Configuration conf;
 
     public HdfsEncryptionShim(URI uri, Configuration conf) throws IOException {
-      DistributedFileSystem dfs = (DistributedFileSystem)FileSystem.get(uri, conf);
-
       this.conf = conf;
-      this.keyProvider = dfs.getClient().getKeyProvider();
       this.hdfsAdmin = new HdfsAdmin(uri, conf);
+      this.keyProvider = getKeyProvider();
+    }
+
+    private KeyProvider getKeyProvider() throws IOException {
+      if (isMethodExist(HdfsAdmin.class, "getKeyProvider")) {

Review comment:
       That is great. I will remove that then. Thanks for pointing.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org