Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 64271200C61 for ; Tue, 25 Apr 2017 23:52:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 630BC160BB8; Tue, 25 Apr 2017 21:52:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B317C160B8E for ; Tue, 25 Apr 2017 23:52:52 +0200 (CEST) Received: (qmail 36343 invoked by uid 500); 25 Apr 2017 21:52:44 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 33347 invoked by uid 99); 25 Apr 2017 21:52:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2017 21:52:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C971ADFBDA; Tue, 25 Apr 2017 21:52:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: varunsaxena@apache.org To: common-commits@hadoop.apache.org Date: Tue, 25 Apr 2017 21:52:52 -0000 Message-Id: In-Reply-To: <03f34a27fa2849929414721c845efbfd@git.apache.org> References: <03f34a27fa2849929414721c845efbfd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/50] [abbrv] hadoop git commit: HDFS-11689. New exception thrown by DFSClient%isHDFSEncryptionEnabled broke hacky hive code. Contributed by Yongjun Zhang. archived-at: Tue, 25 Apr 2017 21:52:53 -0000 HDFS-11689. New exception thrown by DFSClient%isHDFSEncryptionEnabled broke hacky hive code. Contributed by Yongjun Zhang. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5078df7b Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5078df7b Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5078df7b Branch: refs/heads/YARN-5355 Commit: 5078df7be317e635615c05c5da3285798993ff1f Parents: a22fe02 Author: Yongjun Zhang Authored: Fri Apr 21 13:36:31 2017 -0700 Committer: Yongjun Zhang Committed: Fri Apr 21 13:36:31 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/5078df7b/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 ef49950..7773891 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 @@ -2944,10 +2944,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/5078df7b/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 e1c2105..cfe7240 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 @@ -2570,13 +2570,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