You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by td...@apache.org on 2015/06/24 22:24:19 UTC

[23/49] 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/e493215b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e493215b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e493215b

Branch: refs/heads/json
Commit: e493215bff7057bad1a52efecca90384a1dd9412
Parents: afb0120
Author: Nick Dimiduk <nd...@apache.org>
Authored: Tue May 26 17:41:04 2015 -0700
Committer: Nick Dimiduk <nd...@apache.org>
Committed: Tue May 26 17:41:04 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/e493215b/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/e493215b/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/e493215b/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" ),