mustajibmk commented on code in PR #15408:
URL: https://github.com/apache/druid/pull/15408#discussion_r1436020251


##########
processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:
##########
@@ -177,21 +182,75 @@ public static Set<String> 
tryParsePostgresConnectionUri(String connectionUri)
   }
 
   public static Set<String> tryParseMySqlConnectionUri(String connectionUri)
-      throws ClassNotFoundException, NoSuchMethodException, 
InstantiationException, IllegalAccessException,
+      throws ClassNotFoundException, NoSuchMethodException, 
IllegalAccessException,
              InvocationTargetException
   {
-    Class<?> driverClass = Class.forName(MYSQL_NON_REGISTERING_DRIVER);
-    Method parseUrl = driverClass.getMethod("parseURL", String.class, 
Properties.class);
-    // almost the same as postgres, but is an instance level method
-    Properties properties = (Properties) parseUrl.invoke(
-        driverClass.getConstructor().newInstance(),
-        connectionUri,
-        null
-    );
+    Class<?> connectionUrlClass = Class.forName(MYSQL_CONNECTION_URL);

Review Comment:
   Now the method 
   - Checks if the string is in acceptable schema
   - Get the `list<hostInfo>` obtained from the string
   - From the `hostInfo` obtain the properties and return the key of each 
properties 



##########
processing/src/main/java/org/apache/druid/utils/ConnectionUriUtils.java:
##########
@@ -177,21 +182,75 @@ public static Set<String> 
tryParsePostgresConnectionUri(String connectionUri)
   }
 
   public static Set<String> tryParseMySqlConnectionUri(String connectionUri)
-      throws ClassNotFoundException, NoSuchMethodException, 
InstantiationException, IllegalAccessException,
+      throws ClassNotFoundException, NoSuchMethodException, 
IllegalAccessException,
              InvocationTargetException
   {
-    Class<?> driverClass = Class.forName(MYSQL_NON_REGISTERING_DRIVER);
-    Method parseUrl = driverClass.getMethod("parseURL", String.class, 
Properties.class);
-    // almost the same as postgres, but is an instance level method
-    Properties properties = (Properties) parseUrl.invoke(
-        driverClass.getConstructor().newInstance(),
-        connectionUri,
-        null
-    );
+    Class<?> connectionUrlClass = Class.forName(MYSQL_CONNECTION_URL);

Review Comment:
   Now the method 
   - Checks if the string is in acceptable schema
   - Get the `list<hostInfo>` obtained from the string
   - From the `hostInfo` obtain the properties and return the key of each 
property 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to