Return-Path: X-Original-To: apmail-phoenix-commits-archive@minotaur.apache.org Delivered-To: apmail-phoenix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CB1C17AD4 for ; Wed, 27 May 2015 18:12:33 +0000 (UTC) Received: (qmail 48801 invoked by uid 500); 27 May 2015 18:12:33 -0000 Delivered-To: apmail-phoenix-commits-archive@phoenix.apache.org Received: (qmail 48732 invoked by uid 500); 27 May 2015 18:12:33 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 48716 invoked by uid 99); 27 May 2015 18:12:33 -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; Wed, 27 May 2015 18:12:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BEC4E008E; Wed, 27 May 2015 18:12:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndimiduk@apache.org To: commits@phoenix.apache.org Date: Wed, 27 May 2015 18:12:34 -0000 Message-Id: In-Reply-To: <1b2cecd728774109b54ef6b2dbd8ab2a@git.apache.org> References: <1b2cecd728774109b54ef6b2dbd8ab2a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] phoenix git commit: PHOENIX-2005 Connection utilities omit zk client port, parent znode (addendum) PHOENIX-2005 Connection utilities omit zk client port, parent znode (addendum) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/dad5599e Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/dad5599e Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/dad5599e Branch: refs/heads/4.4-HBase-1.0 Commit: dad5599e76a4c28badf8614cfc1cfc733c167bda Parents: bfc4cb3 Author: Nick Dimiduk Authored: Tue May 26 17:41:04 2015 -0700 Committer: Nick Dimiduk Committed: Tue May 26 18:05:28 2015 -0700 ---------------------------------------------------------------------- .../phoenix/jdbc/PhoenixEmbeddedDriver.java | 2 +- .../java/org/apache/phoenix/util/QueryUtil.java | 2 +- .../phoenix/jdbc/PhoenixEmbeddedDriverTest.java | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/dad5599e/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java index 2451603..3cfaacc 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java @@ -209,7 +209,7 @@ public abstract class PhoenixEmbeddedDriver implements Driver, org.apache.phoeni url = url == null ? "" : url; url = url.startsWith(PhoenixRuntime.JDBC_PROTOCOL) ? url.substring(PhoenixRuntime.JDBC_PROTOCOL.length()) - : url; + : PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + url; StringTokenizer tokenizer = new StringTokenizer(url, DELIMITERS, true); int nTokens = 0; String[] tokens = new String[5]; http://git-wip-us.apache.org/repos/asf/phoenix/blob/dad5599e/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java index bd38983..a2d4a91 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/QueryUtil.java @@ -290,7 +290,7 @@ public final class QueryUtil { throws ClassNotFoundException, SQLException { String url = getConnectionUrl(props, conf); - LOG.info("Creating connection with the jdbc url:" + url); + LOG.info("Creating connection with the jdbc url: " + url); PropertiesUtil.extractProperties(props, conf); return DriverManager.getConnection(url, props); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/dad5599e/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java index 083b205..4eda825 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java @@ -34,23 +34,33 @@ public class PhoenixEmbeddedDriverTest { @Test public void testGetConnectionInfo() throws SQLException { String[] urls = new String[] { + null, + "", "jdbc:phoenix", "jdbc:phoenix;test=true", "jdbc:phoenix:localhost", + "localhost", + "localhost;", "jdbc:phoenix:localhost:123", "jdbc:phoenix:localhost:123;foo=bar", + "localhost:123", "jdbc:phoenix:localhost:123:/hbase", "jdbc:phoenix:localhost:123:/foo-bar", "jdbc:phoenix:localhost:123:/foo-bar;foo=bas", + "localhost:123:/foo-bar", "jdbc:phoenix:localhost:/hbase", "jdbc:phoenix:localhost:/foo-bar", "jdbc:phoenix:localhost:/foo-bar;test=true", + "localhost:/foo-bar", "jdbc:phoenix:v1,v2,v3", "jdbc:phoenix:v1,v2,v3;", "jdbc:phoenix:v1,v2,v3;test=true", + "v1,v2,v3", "jdbc:phoenix:v1,v2,v3:/hbase", "jdbc:phoenix:v1,v2,v3:/hbase;test=true", + "v1,v2,v3:/foo-bar", "jdbc:phoenix:v1,v2,v3:123:/hbase", + "v1,v2,v3:123:/hbase", "jdbc:phoenix:v1,v2,v3:123:/hbase;test=false", "jdbc:phoenix:v1,v2,v3:123:/hbase:user/principal:/user.keytab;test=false", "jdbc:phoenix:v1,v2,v3:123:/foo-bar:user/principal:/user.keytab;test=false", @@ -63,20 +73,30 @@ public class PhoenixEmbeddedDriverTest { ConnectionInfo[] infos = new ConnectionInfo[] { new ConnectionInfo(null,null,null), new ConnectionInfo(null,null,null), + new ConnectionInfo(null,null,null), + new ConnectionInfo(null,null,null), + new ConnectionInfo("localhost",null,null), new ConnectionInfo("localhost",null,null), + new ConnectionInfo("localhost",null,null), + new ConnectionInfo("localhost",123,null), new ConnectionInfo("localhost",123,null), new ConnectionInfo("localhost",123,null), new ConnectionInfo("localhost",123,"/hbase"), new ConnectionInfo("localhost",123,"/foo-bar"), new ConnectionInfo("localhost",123,"/foo-bar"), + new ConnectionInfo("localhost",123,"/foo-bar"), new ConnectionInfo("localhost",null,"/hbase"), new ConnectionInfo("localhost",null,"/foo-bar"), new ConnectionInfo("localhost",null,"/foo-bar"), + new ConnectionInfo("localhost",null,"/foo-bar"), + new ConnectionInfo("v1,v2,v3",null,null), new ConnectionInfo("v1,v2,v3",null,null), new ConnectionInfo("v1,v2,v3",null,null), new ConnectionInfo("v1,v2,v3",null,null), new ConnectionInfo("v1,v2,v3",null,"/hbase"), new ConnectionInfo("v1,v2,v3",null,"/hbase"), + new ConnectionInfo("v1,v2,v3",null,"/foo-bar"), + new ConnectionInfo("v1,v2,v3",123,"/hbase"), new ConnectionInfo("v1,v2,v3",123,"/hbase"), new ConnectionInfo("v1,v2,v3",123,"/hbase"), new ConnectionInfo("v1,v2,v3",123,"/hbase","user/principal", "/user.keytab" ),