You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/09/01 07:53:36 UTC
[GitHub] [phoenix] stoty commented on a change in pull request #1280: PHOENIX-6523: Support for HRpc connection protocol through JDBC URL
stoty commented on a change in pull request #1280:
URL: https://github.com/apache/phoenix/pull/1280#discussion_r699970369
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriver.java
##########
@@ -225,16 +232,45 @@ private static boolean isMultiPortUrl(String portStr) {
}
return false;
}
-
+
public static ConnectionInfo create(String url) throws SQLException {
url = url == null ? "" : url;
if (url.isEmpty() || url.equalsIgnoreCase("jdbc:phoenix:")
|| url.equalsIgnoreCase("jdbc:phoenix")) {
return defaultConnectionInfo(url);
}
+
+ // ex: jdbc:phoenix+hrpc:hostname1....
url = url.startsWith(PhoenixRuntime.JDBC_PROTOCOL)
? url.substring(PhoenixRuntime.JDBC_PROTOCOL.length())
: PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + url;
+
+ HBaseRegistryBootstrapType bootstrapAsEnum = null;
+
+ // ex: +hrpc:hostname1....
+ if (url.startsWith(String.valueOf(PhoenixRuntime.JDBC_PROTOCOL_CONNECTOR_PREFIX))) {
+ int offset = url.indexOf(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR);
+ final String firstToken = url.substring(0, offset);
+
+ // ex: +hrpc
+ final String bootstrapString = firstToken
+ .replace(String.valueOf(PhoenixRuntime.JDBC_PROTOCOL_CONNECTOR_PREFIX), "")
+ .toUpperCase();
+
+ if (Strings.isNullOrEmpty(bootstrapString)) {
+ throw getMalFormedUrlException(url);
Review comment:
Right, I didn't notice this block is only for URLS that have the "+" character.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org