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/3c6b6ac3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3c6b6ac3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3c6b6ac3 Branch: refs/heads/4.4-HBase-1.1 Commit: 3c6b6ac36af759320baee20fe833e19feff67b25 Parents: 5a6b996 Author: ravimagham <ravimag...@apache.org> Authored: Tue Jul 7 22:13:42 2015 -0700 Committer: ravimagham <ravimag...@apache.org> Committed: Tue Jul 7 22:13:42 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/3c6b6ac3/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/3c6b6ac3/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 {