[MDEV-31231] Remove JavaWrappers.jar from mariadb-test-data and create new mariadb-plugin-connect-jdbc package Created: 2023-05-10  Updated: 2023-10-01  Resolved: 2023-08-30

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Storage Engine - Connect
Fix Version/s: 11.3.1

Type: Task Priority: Major
Reporter: Anel Husakovic Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-10936 CONNECT engine JDBC type can't find J... Closed

 Description   
  • JavaWrappers.jar is huge file consisting of precompiled binaries with external modules. We should build only library needed for interfacing the external modules and store in new package mariadb-plugin-connect-jdbc.
  • This MDEV should implement:
    • Remove JavaWrappers.jar from source .
    • From all files only JdbcInterface should be compiled and part of new package mariadb-plugin-connect-jdbc. For now leave other *Interface.java files (later I think may be removed).
    • Remove JDBCMariaDB.jar from source.
    • It will decrease source code by ~6[MB] .
  • Connect SE has JavaWrappers.jar file that consists of compiled byte code with interfaces that is compiled in the source code as well as shipped with mariadb-test-data package.

    $ jar tf /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/JavaWrappers.jar|grep class
    wrappers/PostgresqlInterface.class
    wrappers/OracleInterface.class
    wrappers/ApacheInterface.class
    wrappers/Client.class
    wrappers/JdbcInterface.class
    wrappers/MysqlInterface.class
    wrappers/MariadbInterface.class
    

    Only JdbcInterface is used (I think, more tests are needed for this claim?) to have proper JDBC interface.

  • Besides that there is pre-compiled JdbcMariaDB.jar that has internally pre-compiled MariaDB Connector J, Oracle connector, etc.

    $ jar tf /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/JdbcMariaDB.jar
    META-INF/
    META-INF/MANIFEST.MF
    META-INF/FILETEST.DSA
    META-INF/INDEX.LIST
    META-INF/LICENSE.txt
    META-INF/NOTICE.txt
    META-INF/maven/
    META-INF/maven/commons-logging/
    META-INF/maven/commons-logging/commons-logging/
    META-INF/maven/commons-logging/commons-logging/pom.properties
    META-INF/maven/commons-logging/commons-logging/pom.xml
    META-INF/maven/org.apache.commons/
    META-INF/maven/org.apache.commons/commons-dbcp2/
    META-INF/maven/org.apache.commons/commons-dbcp2/pom.properties
    META-INF/maven/org.apache.commons/commons-dbcp2/pom.xml
    META-INF/maven/org.apache.commons/commons-pool2/
    META-INF/maven/org.apache.commons/commons-pool2/pom.properties
    META-INF/maven/org.apache.commons/commons-pool2/pom.xml
    META-INF/maven/org.mariadb.jdbc/
    META-INF/maven/org.mariadb.jdbc/mariadb-java-client/
    META-INF/maven/org.mariadb.jdbc/mariadb-java-client/pom.properties
    META-INF/maven/org.mariadb.jdbc/mariadb-java-client/pom.xml
    META-INF/maven/org.postgresql/
    META-INF/maven/org.postgresql/postgresql/
    META-INF/maven/org.postgresql/postgresql/pom.properties
    META-INF/maven/org.postgresql/postgresql/pom.xml
    com/
    com/mysql/
    com/mysql/cj/
    oracle/
    oracle/core/
    oracle/core/lmx/
    oracle/core/lmx/CoreException.class
    oracle/core/lmx/LmxRepConversion.class
    oracle/core/lvf/
    oracle/core/lvf/VersionMgr.class
    oracle/jdbc/
    oracle/jpub
    oracle/net
    oracle/security
    oracle/sql
    org/apache/
    org/mariadb/jdbc
    org/postgresql
    ```
    org/slf4j
    wrappers/ApacheInterface.class
    wrappers/Client.class
    wrappers/HikariCPInterface.Copie
    wrappers/JdbcInterface.class
    wrappers/MariadbInterface.class
    wrappers/MysqlInterface.class
    wrappers/OracleInterface.class
    wrappers/PostgresqlInterface.class
    
    

    This file should also be removed and external packages should be installed when needed, like (libmariadb-java.

  • The similar logic applies to Mongo2.jar and Mongo3.jar that should be part of future re-design and appropriate testing.
  • As future work code re-design of JDBC may be desirable.


 Comments   
Comment by Anel Husakovic [ 2023-05-12 ]

Development branch for review https://github.com/an3l/server/commit/063d1916ee0aa457587c7e4a003ffc48654c383d

Comment by Anel Husakovic [ 2023-05-18 ]

Note this comment saying about usage INSTALL over INSTALL_JAR that doesn't work on RPM.
Note this comment from 2017 where JdbcInterface.jar was the only file and was replaced by Olivier with JavaWrappers.jar.

Comment by Daniel Black [ 2023-05-22 ]

Was missing:

SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} connect-engine-jdbc PARENT_SCOPE)

Generated at Thu Feb 08 10:22:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.