phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravimag...@apache.org
Subject [3/6] phoenix git commit: PHOENIX-2025 - Phoenix-core's hbase-default.xml prevents HBaseTestingUtility from starting up in client apps - (Thomas D'Silva)
Date Wed, 08 Jul 2015 05:15:55 GMT
PHOENIX-2025 - Phoenix-core's hbase-default.xml prevents HBaseTestingUtility from starting
up in client apps - (Thomas D'Silva)


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b3d1f12f
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b3d1f12f
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b3d1f12f

Branch: refs/heads/4.4-HBase-1.0
Commit: b3d1f12ff7da66815e32ce6533d003320f916ac5
Parents: cac6d57
Author: ravimagham <ravimagham@apache.org>
Authored: Tue Jul 7 22:12:58 2015 -0700
Committer: ravimagham <ravimagham@apache.org>
Committed: Tue Jul 7 22:12:58 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java | 4 ++--
 .../phoenix/mapreduce/util/PhoenixConfigurationUtil.java       | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b3d1f12f/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
index 000ce59..b4724d8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/ConnectionUtil.java
@@ -88,9 +88,9 @@ public class ConnectionUtil {
      * @param clientPort a ZooKeeper client port
      * @return a Phoenix connection to the given connection string
      */
-    private static Connection getConnection(final String quorum, final int clientPort, Properties
props) throws SQLException {
+    private static Connection getConnection(final String quorum, final Integer clientPort,
Properties props) throws SQLException {
         Preconditions.checkNotNull(quorum);
-        return DriverManager.getConnection(QueryUtil.getUrl(quorum, clientPort), props);
+        return DriverManager.getConnection(clientPort!=null? QueryUtil.getUrl(quorum, clientPort)
:  QueryUtil.getUrl(quorum), props);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b3d1f12f/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixConfigurationUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixConfigurationUtil.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixConfigurationUtil.java
index bba96ac..e26f988 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixConfigurationUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixConfigurationUtil.java
@@ -27,6 +27,7 @@ import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Splitter;
 import com.google.common.collect.Lists;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -371,9 +372,10 @@ public final class PhoenixConfigurationUtil {
      * @param configuration
      * @return
      */
-    public static int getClientPort(final Configuration configuration) {
+    public static Integer getClientPort(final Configuration configuration) {
         Preconditions.checkNotNull(configuration);
-        return Integer.parseInt(configuration.get(HBASE_ZOOKEEPER_CLIENT_PORT));
+        String clientPortString = configuration.get(HBASE_ZOOKEEPER_CLIENT_PORT);
+        return clientPortString==null ? null : Integer.parseInt(clientPortString);
     }
 
     public static void loadHBaseConfiguration(Job job) throws IOException {


Mime
View raw message