Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F206110B1 for ; Wed, 17 Sep 2014 04:57:51 +0000 (UTC) Received: (qmail 61423 invoked by uid 500); 17 Sep 2014 04:57:51 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 61327 invoked by uid 500); 17 Sep 2014 04:57:51 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 61302 invoked by uid 99); 17 Sep 2014 04:57:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 04:57:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 06BF4A17BFF; Wed, 17 Sep 2014 04:57:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Wed, 17 Sep 2014 04:57:51 -0000 Message-Id: <6518c8f71e9a435581ea228ceeef39ee@git.apache.org> In-Reply-To: <364f3459829445a7b6fadd3a6485594c@git.apache.org> References: <364f3459829445a7b6fadd3a6485594c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] git commit: ACCUMULO-3138 Pass down the SSL/CredentialProvider ClientConfiguration into the input format ACCUMULO-3138 Pass down the SSL/CredentialProvider ClientConfiguration into the input format Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3e4d07b2 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3e4d07b2 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3e4d07b2 Branch: refs/heads/master Commit: 3e4d07b2fd967328fe1161b0dfad1fdf72191829 Parents: 2e27350 Author: Josh Elser Authored: Wed Sep 17 00:56:25 2014 -0400 Committer: Josh Elser Committed: Wed Sep 17 00:56:25 2014 -0400 ---------------------------------------------------------------------- .../test/functional/AccumuloInputFormatIT.java | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/3e4d07b2/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java index 5f33436..acd7440 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java @@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.ClientConfiguration; +import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.TableExistsException; import org.apache.accumulo.core.client.TableNotFoundException; @@ -69,11 +70,27 @@ public class AccumuloInputFormatIT extends SimpleMacIT { conn.tableOperations().create(table); insertData(table, currentTimeMillis()); + ClientConfiguration clientConf = new ClientConfiguration().withInstance(conn.getInstance().getInstanceName()).withZkHosts( + conn.getInstance().getZooKeepers()), clusterClientConf = getStaticCluster().getClientConfig(); + + // Pass SSL and CredentialProvider options into the ClientConfiguration given to AccumuloInputFormat + boolean sslEnabled = Boolean.valueOf(clusterClientConf.get(ClientProperty.INSTANCE_RPC_SSL_ENABLED)); + if (sslEnabled) { + ClientProperty[] sslProperties = new ClientProperty[] {ClientProperty.INSTANCE_RPC_SSL_ENABLED, ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, + ClientProperty.RPC_SSL_KEYSTORE_PATH, ClientProperty.RPC_SSL_KEYSTORE_TYPE, ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, + ClientProperty.RPC_SSL_TRUSTSTORE_PATH, ClientProperty.RPC_SSL_TRUSTSTORE_TYPE, ClientProperty.RPC_SSL_TRUSTSTORE_PASSWORD, + ClientProperty.RPC_USE_JSSE, ClientProperty.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS}; + + for (ClientProperty prop : sslProperties) { + // The default property is returned if it's not in the ClientConfiguration so we don't have to check if the value is actually defined + clientConf.setProperty(prop, clusterClientConf.get(prop)); + } + } + @SuppressWarnings("deprecation") Job job = new Job(); AccumuloInputFormat.setInputTableName(job, table); - AccumuloInputFormat.setZooKeeperInstance(job, new ClientConfiguration().withInstance(conn.getInstance().getInstanceName()) - .withZkHosts(conn.getInstance().getZooKeepers())); + AccumuloInputFormat.setZooKeeperInstance(job, clientConf); AccumuloInputFormat.setConnectorInfo(job, "root", new PasswordToken(ROOT_PASSWORD)); // split table