You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/07/06 03:27:48 UTC

[GitHub] [druid] maytasm commented on a change in pull request #11402: support using mariadb connector with mysql extensions

maytasm commented on a change in pull request #11402:
URL: https://github.com/apache/druid/pull/11402#discussion_r664194009



##########
File path: extensions-core/mysql-metadata-storage/src/main/java/org/apache/druid/firehose/sql/MySQLFirehoseDatabaseConnector.java
##########
@@ -43,17 +40,21 @@
 {
   private final DBI dbi;
   private final MetadataStorageConnectorConfig connectorConfig;
+  @Nullable
+  private final String driverClassName;
 
   @JsonCreator
   public MySQLFirehoseDatabaseConnector(
       @JsonProperty("connectorConfig") MetadataStorageConnectorConfig connectorConfig,
+      @JsonProperty("driverClassName") @Nullable String driverClassName,
       @JacksonInject JdbcAccessSecurityConfig securityConfig
   )
   {
     this.connectorConfig = connectorConfig;
+    this.driverClassName = driverClassName;

Review comment:
       Should we check if the connectURL and driverClassName match? i.e. we can gracefully fail if we get connectURL=jdbc:mariadb://localhost:3306/test?... and driverClassName=com.mysql.jdbc.Driver

##########
File path: integration-tests/docker/Dockerfile
##########
@@ -47,16 +49,21 @@ ADD lib/* /usr/local/druid/lib/
 
 # Download the MySQL Java connector
 # target path must match the exact path referenced in environment-configs/common
-RUN wget -q "https://repo1.maven.org/maven2/mysql/mysql-connector-java/$MYSQL_VERSION/mysql-connector-java-$MYSQL_VERSION.jar" \
-    -O /usr/local/druid/lib/mysql-connector-java.jar
-
+# alternatively: Download the MariaDB Java connector, and pretend it is the mysql connector
+RUN if [ "$MYSQL_DRIVER_CLASSNAME" = "com.mysql.jdbc.Driver" ] ; \
+    then wget -q "https://repo1.maven.org/maven2/mysql/mysql-connector-java/$MYSQL_VERSION/mysql-connector-java-$MYSQL_VERSION.jar" \
+    -O /usr/local/druid/lib/mysql-connector-java.jar; \
+    else wget -q "https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/$MARIA_VERSION/mariadb-java-client-$MARIA_VERSION.jar" \

Review comment:
       Should this be else if and check that the MYSQL_DRIVER_CLASSNAME is set to Maria? But we easier to read/test when we add more driver classes




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org