Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C013817D58 for ; Mon, 16 Mar 2015 22:49:38 +0000 (UTC) Received: (qmail 99283 invoked by uid 500); 16 Mar 2015 22:49:38 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 99262 invoked by uid 500); 16 Mar 2015 22:49:38 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 99248 invoked by uid 99); 16 Mar 2015 22:49:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2015 22:49:38 +0000 Date: Mon, 16 Mar 2015 22:49:38 +0000 (UTC) From: =?utf-8?Q?Sergio_Pe=C3=B1a_=28JIRA=29?= To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9981) Avoid throwing many exceptions when attempting to create new hdfs encryption shim MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-9981?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Sergio Pe=C3=B1a updated HIVE-9981: ------------------------------ Attachment: HIVE-9981.2.patch Thanks [~thejas] I did not see that issue. This patch uses a Boolean object instead to keep = track of the encryption support. > Avoid throwing many exceptions when attempting to create new hdfs encrypt= ion shim > -------------------------------------------------------------------------= -------- > > Key: HIVE-9981 > URL: https://issues.apache.org/jira/browse/HIVE-9981 > Project: Hive > Issue Type: Improvement > Components: Encryption > Reporter: Sergio Pe=C3=B1a > Assignee: Sergio Pe=C3=B1a > Attachments: HIVE-9981.1.patch, HIVE-9981.2.patch > > > Hadoop23Shims.createHdfsEncryptionShim() is throwing an exception for ver= ions lower than 2.6.0 everytime a query is executed. > Exceptions are expensive, so rather than throwing them every time, we can= use this design pattern followed for some other functions in Hadoop23Shims= - > {code} > protected static final Method accessMethod; > protected static final Method getPasswordMethod; > static { > Method m =3D null; > try { > m =3D FileSystem.class.getMethod("access", Path.class, FsAction.cla= ss); > } catch (NoSuchMethodException err) { > // This version of Hadoop does not support FileSystem.access(). > } > accessMethod =3D m; > try { > m =3D Configuration.class.getMethod("getPassword", String.class); > } catch (NoSuchMethodException err) { > // This version of Hadoop does not support getPassword(), just retr= ieve password from conf. > m =3D null; > } > getPasswordMethod =3D m; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)