karanmehta93 commented on a change in pull request #453: [PHOENIX-5172] Harden
the PQS canary synth test tool with retry mechanism and more logging
URL: https://github.com/apache/phoenix/pull/453#discussion_r263115317
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/tool/PhoenixCanaryTool.java
##########
@@ -396,16 +324,7 @@ public int run(String[] args) throws Exception {
Properties connProps = new Properties();
connProps.setProperty("phoenix.schema.mapSystemTablesToNamespace",
"true");
connProps.setProperty("phoenix.schema.isNamespaceMappingEnabled",
"true");
-
- try {
- connection = DriverManager.getConnection(connectionURL,
connProps);
- } catch (Exception e) {
- LOG.info("Namespace mapping cannot be set. Using default
schema");
- USE_NAMESPACE = false;
- connection = DriverManager.getConnection(connectionURL);
- TEST_SCHEMA_NAME = null;
- FQ_TABLE_NAME = TEST_TABLE_NAME;
- }
+ connection = getConnectionWithRetry(connectionURL, connProps);
Review comment:
Also good to have a null check here or throw the exception from method in
case of failure.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services