From c9aac1161ad88f2a6f798f1b6b80cda873c457ef Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sat, 11 Nov 2023 12:50:09 +0800 Subject: [PATCH] Adds JAXB dependency --- .../infra/nativetest/FileTestUtils.java | 2 +- .../reflect-config.json | 142 +++++++++++++ .../resource-config.json | 19 ++ .../nativetest/src/test/resources/logback.xml | 34 --- .../jni-config.json | 2 +- .../proxy-config.json | 2 +- .../reflect-config.json | 193 ++++++++++-------- .../resource-config.json | 20 +- .../serialization-config.json | 2 +- kernel/sql-federation/core/pom.xml | 9 +- kernel/sql-federation/executor/pom.xml | 9 +- kernel/sql-federation/optimizer/pom.xml | 9 +- .../type/xa/provider/narayana/pom.xml | 8 +- .../repository/provider/jdbc/pom.xml | 8 +- .../jdbc/sql/JDBCRepositorySQLLoader.java | 10 +- pom.xml | 16 +- test/pom.xml | 8 +- 17 files changed, 300 insertions(+), 193 deletions(-) create mode 100644 infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/reflect-config.json create mode 100644 infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/resource-config.json delete mode 100644 infra/nativetest/src/test/resources/logback.xml diff --git a/infra/nativetest/src/test/java/org/apache/shardingsphere/infra/nativetest/FileTestUtils.java b/infra/nativetest/src/test/java/org/apache/shardingsphere/infra/nativetest/FileTestUtils.java index 30768fb598a657..074da7dd05bd1e 100644 --- a/infra/nativetest/src/test/java/org/apache/shardingsphere/infra/nativetest/FileTestUtils.java +++ b/infra/nativetest/src/test/java/org/apache/shardingsphere/infra/nativetest/FileTestUtils.java @@ -27,7 +27,7 @@ /** * The background for this class comes from oracle/graal#7682 - * and Accessing Resources in Native Image. + * and Accessing Resources in Native Image. * GraalVM Native Image has special features in its handling of file systems. * This means we are better off reading the file via `java.io.InputStream` instead of `java.net.URL` to avoid extra code * processing. diff --git a/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/reflect-config.json b/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/reflect-config.json new file mode 100644 index 00000000000000..b2b39c124e71a0 --- /dev/null +++ b/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/reflect-config.json @@ -0,0 +1,142 @@ +[ +{ + "name":"org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +}, +{ + "name":"org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader", + "allDeclaredClasses": true, + "allDeclaredMethods": true, + "allDeclaredFields": true, + "allDeclaredConstructors": true, + "allPublicClasses": true, + "allPublicMethods": true, + "allPublicFields": true, + "allPublicConstructors": true, + "allRecordComponents": true, + "allNestMembers": true, + "allSigners": true, + "allPermittedSubclasses": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllPublicConstructors": true, + "unsafeAllocated": true +} +] diff --git a/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/resource-config.json b/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/resource-config.json new file mode 100644 index 00000000000000..386706faafa814 --- /dev/null +++ b/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-infra-nativetest-test-image/resource-config.json @@ -0,0 +1,19 @@ +{ + "resources":{ + "includes":[{ + "pattern":"\\Qsql/H2.xml\\E" + }, { + "pattern":"\\Qsql/MySQL.xml\\E" + }, { + "pattern":"\\Qyaml/encrypt.yaml\\E" + }, { + "pattern":"\\Qyaml/mask.yaml\\E" + }, { + "pattern":"\\Qyaml/readwrite-splitting.yaml\\E" + }, { + "pattern":"\\Qyaml/shadow.yaml\\E" + }, { + "pattern":"\\Qyaml/sharding.yaml\\E" + }]}, + "bundles":[] +} \ No newline at end of file diff --git a/infra/nativetest/src/test/resources/logback.xml b/infra/nativetest/src/test/resources/logback.xml deleted file mode 100644 index a4847ef2c0bda2..00000000000000 --- a/infra/nativetest/src/test/resources/logback.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - ${log.context.name} - - - - ${log.pattern} - - - - - - - diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/jni-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/jni-config.json index c8b081385033ae..0ee2739762f2dc 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/jni-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/jni-config.json @@ -7,4 +7,4 @@ "name":"sun.management.VMManagementImpl", "fields":[{"name":"compTimeMonitoringSupport"}, {"name":"currentThreadCpuTimeSupport"}, {"name":"objectMonitorUsageSupport"}, {"name":"otherThreadCpuTimeSupport"}, {"name":"remoteDiagnosticCommandsSupport"}, {"name":"synchronizerUsageSupport"}, {"name":"threadAllocatedMemorySupport"}, {"name":"threadContentionMonitoringSupport"}] } -] +] \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/proxy-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/proxy-config.json index 641a8f15102354..fbfaf87cb7a19f 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/proxy-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/proxy-config.json @@ -2,4 +2,4 @@ { "interfaces":["java.sql.Connection"] } -] +] \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json index 5a2d98a818c4df..b5671e470b6bb2 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/reflect-config.json @@ -20,126 +20,120 @@ "name":"Script1Customizer" }, { - "name":"[B" -}, -{ - "name":"[C" -}, -{ - "name":"[I" -}, -{ - "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" + "name":"Script2", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["groovy.lang.Binding"] }] }, { - "name":"[Ljava.io.ObjectStreamField;" + "name":"Script2BeanInfo" }, { - "name":"[Ljava.lang.CharSequence;" + "name":"Script2Customizer" }, { - "name":"[Ljava.lang.Class;" + "name":"Script3", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["groovy.lang.Binding"] }] }, { - "name":"[Ljava.lang.Object;" + "name":"Script3BeanInfo" }, { - "name":"[Ljava.lang.String;" + "name":"Script3Customizer" }, { - "name":"[Ljava.lang.annotation.Annotation;" + "name":"Script4", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["groovy.lang.Binding"] }] }, { - "name":"[Ljava.lang.reflect.AnnotatedType;" + "name":"Script4BeanInfo" }, { - "name":"[Ljava.lang.reflect.Constructor;" + "name":"Script4Customizer" }, { - "name":"[Ljava.lang.reflect.Field;" + "name":"Script5", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllPublicMethods":true, + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["groovy.lang.Binding"] }] }, { - "name":"[Ljava.lang.reflect.Method;" + "name":"Script5BeanInfo" }, { - "name":"[Ljava.lang.reflect.RecordComponent;" + "name":"Script5Customizer" }, { - "name":"[Ljava.lang.reflect.Type;" + "name":"[B" }, { - "name":"[Ljava.lang.reflect.TypeVariable;" + "name":"[C" }, { - "name":"[Ljava.sql.Statement;" + "name":"[I" }, { - "name":"[Lorg.codehaus.groovy.runtime.callsite.CallSite;" + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { - "name":"[Lsun.security.pkcs.SignerInfo;" + "name":"[Ljava.io.ObjectStreamField;" }, { - "name":"ch.qos.logback.classic.encoder.PatternLayoutEncoder", - "queryAllPublicMethods":true, - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.CharSequence;" }, { - "name":"ch.qos.logback.classic.joran.SerializedModelConfigurator", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.Class;" }, { - "name":"ch.qos.logback.classic.pattern.DateConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.Object;" }, { - "name":"ch.qos.logback.classic.pattern.LevelConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.String;" }, { - "name":"ch.qos.logback.classic.pattern.LineSeparatorConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.annotation.Annotation;" }, { - "name":"ch.qos.logback.classic.pattern.LoggerConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.reflect.AnnotatedType;" }, { - "name":"ch.qos.logback.classic.pattern.MessageConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.reflect.Constructor;" }, { - "name":"ch.qos.logback.classic.pattern.ThreadConverter", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.reflect.Field;" }, { - "name":"ch.qos.logback.classic.util.DefaultJoranConfigurator", - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.reflect.Method;" }, { - "name":"ch.qos.logback.core.ConsoleAppender", - "queryAllPublicMethods":true, - "methods":[{"name":"","parameterTypes":[] }] + "name":"[Ljava.lang.reflect.RecordComponent;" }, { - "name":"ch.qos.logback.core.OutputStreamAppender", - "methods":[{"name":"setEncoder","parameterTypes":["ch.qos.logback.core.encoder.Encoder"] }] + "name":"[Ljava.lang.reflect.Type;" }, { - "name":"ch.qos.logback.core.encoder.Encoder", - "methods":[{"name":"valueOf","parameterTypes":["java.lang.String"] }] + "name":"[Ljava.lang.reflect.TypeVariable;" }, { - "name":"ch.qos.logback.core.encoder.LayoutWrappingEncoder", - "methods":[{"name":"setParent","parameterTypes":["ch.qos.logback.core.spi.ContextAware"] }] + "name":"[Ljava.sql.Statement;" }, { - "name":"ch.qos.logback.core.pattern.PatternLayoutEncoderBase", - "methods":[{"name":"setPattern","parameterTypes":["java.lang.String"] }] + "name":"[Lorg.codehaus.groovy.runtime.callsite.CallSite;" }, { - "name":"ch.qos.logback.core.spi.ContextAware", - "methods":[{"name":"valueOf","parameterTypes":["java.lang.String"] }] + "name":"[Lsun.security.pkcs.SignerInfo;" }, { "name":"com.github.benmanes.caffeine.cache.BBHeader$ReadAndWriteCounterRef", @@ -243,14 +237,15 @@ }, { "name":"com.zaxxer.hikari.HikariConfig", + "queryAllPublicMethods":true, "fields":[{"name":"dataSourceProperties"}, {"name":"jdbcUrl"}], - "methods":[{"name":"getCatalog","parameterTypes":[] }, {"name":"getConnectionInitSql","parameterTypes":[] }, {"name":"getConnectionTestQuery","parameterTypes":[] }, {"name":"getConnectionTimeout","parameterTypes":[] }, {"name":"getDataSourceClassName","parameterTypes":[] }, {"name":"getDataSourceJNDI","parameterTypes":[] }, {"name":"getDataSourceProperties","parameterTypes":[] }, {"name":"getExceptionOverrideClassName","parameterTypes":[] }, {"name":"getHealthCheckProperties","parameterTypes":[] }, {"name":"getIdleTimeout","parameterTypes":[] }, {"name":"getInitializationFailTimeout","parameterTypes":[] }, {"name":"getJdbcUrl","parameterTypes":[] }, {"name":"getKeepaliveTime","parameterTypes":[] }, {"name":"getLeakDetectionThreshold","parameterTypes":[] }, {"name":"getMaxLifetime","parameterTypes":[] }, {"name":"getMaximumPoolSize","parameterTypes":[] }, {"name":"getMinimumIdle","parameterTypes":[] }, {"name":"getPassword","parameterTypes":[] }, {"name":"getPoolName","parameterTypes":[] }, {"name":"getSchema","parameterTypes":[] }, {"name":"getTransactionIsolation","parameterTypes":[] }, {"name":"getUsername","parameterTypes":[] }, {"name":"getValidationTimeout","parameterTypes":[] }, {"name":"isAllowPoolSuspension","parameterTypes":[] }, {"name":"isAutoCommit","parameterTypes":[] }, {"name":"isIsolateInternalQueries","parameterTypes":[] }, {"name":"isReadOnly","parameterTypes":[] }, {"name":"isRegisterMbeans","parameterTypes":[] }, {"name":"setConnectionTimeout","parameterTypes":["long"] }, {"name":"setDataSourceProperties","parameterTypes":["java.util.Properties"] }, {"name":"setIdleTimeout","parameterTypes":["long"] }, {"name":"setJdbcUrl","parameterTypes":["java.lang.String"] }, {"name":"setKeepaliveTime","parameterTypes":["long"] }, {"name":"setMaxLifetime","parameterTypes":["long"] }, {"name":"setMaximumPoolSize","parameterTypes":["int"] }, {"name":"setMinimumIdle","parameterTypes":["int"] }, {"name":"setPassword","parameterTypes":["java.lang.String"] }, {"name":"setReadOnly","parameterTypes":["boolean"] }, {"name":"setUsername","parameterTypes":["java.lang.String"] }] + "methods":[{"name":"getCatalog","parameterTypes":[] }, {"name":"getConnectionInitSql","parameterTypes":[] }, {"name":"getConnectionTestQuery","parameterTypes":[] }, {"name":"getConnectionTimeout","parameterTypes":[] }, {"name":"getDataSource","parameterTypes":[] }, {"name":"getDataSourceClassName","parameterTypes":[] }, {"name":"getDataSourceJNDI","parameterTypes":[] }, {"name":"getDataSourceProperties","parameterTypes":[] }, {"name":"getDriverClassName","parameterTypes":[] }, {"name":"getExceptionOverrideClassName","parameterTypes":[] }, {"name":"getHealthCheckProperties","parameterTypes":[] }, {"name":"getHealthCheckRegistry","parameterTypes":[] }, {"name":"getIdleTimeout","parameterTypes":[] }, {"name":"getInitializationFailTimeout","parameterTypes":[] }, {"name":"getJdbcUrl","parameterTypes":[] }, {"name":"getKeepaliveTime","parameterTypes":[] }, {"name":"getLeakDetectionThreshold","parameterTypes":[] }, {"name":"getMaxLifetime","parameterTypes":[] }, {"name":"getMaximumPoolSize","parameterTypes":[] }, {"name":"getMetricRegistry","parameterTypes":[] }, {"name":"getMetricsTrackerFactory","parameterTypes":[] }, {"name":"getMinimumIdle","parameterTypes":[] }, {"name":"getPassword","parameterTypes":[] }, {"name":"getPoolName","parameterTypes":[] }, {"name":"getScheduledExecutor","parameterTypes":[] }, {"name":"getSchema","parameterTypes":[] }, {"name":"getThreadFactory","parameterTypes":[] }, {"name":"getTransactionIsolation","parameterTypes":[] }, {"name":"getUsername","parameterTypes":[] }, {"name":"getValidationTimeout","parameterTypes":[] }, {"name":"isAllowPoolSuspension","parameterTypes":[] }, {"name":"isAutoCommit","parameterTypes":[] }, {"name":"isIsolateInternalQueries","parameterTypes":[] }, {"name":"isReadOnly","parameterTypes":[] }, {"name":"isRegisterMbeans","parameterTypes":[] }, {"name":"setAllowPoolSuspension","parameterTypes":["boolean"] }, {"name":"setAutoCommit","parameterTypes":["boolean"] }, {"name":"setCatalog","parameterTypes":["java.lang.String"] }, {"name":"setClass","parameterTypes":["java.lang.Class"] }, {"name":"setConnectionInitSql","parameterTypes":["java.lang.String"] }, {"name":"setConnectionTestQuery","parameterTypes":["java.lang.String"] }, {"name":"setConnectionTimeout","parameterTypes":["long"] }, {"name":"setDataSource","parameterTypes":["javax.sql.DataSource"] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setDataSourceJNDI","parameterTypes":["java.lang.String"] }, {"name":"setDataSourceProperties","parameterTypes":["java.util.Properties"] }, {"name":"setDriverClassName","parameterTypes":["java.lang.String"] }, {"name":"setExceptionOverrideClassName","parameterTypes":["java.lang.String"] }, {"name":"setHealthCheckProperties","parameterTypes":["java.util.Properties"] }, {"name":"setHealthCheckRegistry","parameterTypes":["java.lang.Object"] }, {"name":"setIdleTimeout","parameterTypes":["long"] }, {"name":"setInitializationFailTimeout","parameterTypes":["long"] }, {"name":"setIsolateInternalQueries","parameterTypes":["boolean"] }, {"name":"setJdbcUrl","parameterTypes":["java.lang.String"] }, {"name":"setKeepaliveTime","parameterTypes":["long"] }, {"name":"setLeakDetectionThreshold","parameterTypes":["long"] }, {"name":"setMaxLifetime","parameterTypes":["long"] }, {"name":"setMaximumPoolSize","parameterTypes":["int"] }, {"name":"setMetricRegistry","parameterTypes":["java.lang.Object"] }, {"name":"setMetricsTrackerFactory","parameterTypes":["com.zaxxer.hikari.metrics.MetricsTrackerFactory"] }, {"name":"setMinimumIdle","parameterTypes":["int"] }, {"name":"setPassword","parameterTypes":["java.lang.String"] }, {"name":"setPoolName","parameterTypes":["java.lang.String"] }, {"name":"setReadOnly","parameterTypes":["boolean"] }, {"name":"setRegisterMbeans","parameterTypes":["boolean"] }, {"name":"setScheduledExecutor","parameterTypes":["java.util.concurrent.ScheduledExecutorService"] }, {"name":"setSchema","parameterTypes":["java.lang.String"] }, {"name":"setThreadFactory","parameterTypes":["java.util.concurrent.ThreadFactory"] }, {"name":"setTransactionIsolation","parameterTypes":["java.lang.String"] }, {"name":"setUsername","parameterTypes":["java.lang.String"] }, {"name":"setValidationTimeout","parameterTypes":["long"] }] }, { "name":"com.zaxxer.hikari.HikariDataSource", "queryAllPublicMethods":true, "fields":[{"name":"dataSourceProperties"}, {"name":"jdbcUrl"}], - "methods":[{"name":"","parameterTypes":[] }, {"name":"isClosed","parameterTypes":[] }, {"name":"isRunning","parameterTypes":[] }] + "methods":[{"name":"","parameterTypes":[] }, {"name":"getAllowPoolSuspension","parameterTypes":[] }, {"name":"getAutoCommit","parameterTypes":[] }, {"name":"getIsolateInternalQueries","parameterTypes":[] }, {"name":"getReadOnly","parameterTypes":[] }, {"name":"getRegisterMbeans","parameterTypes":[] }, {"name":"isClosed","parameterTypes":[] }, {"name":"isRunning","parameterTypes":[] }] }, { "name":"com.zaxxer.hikari.pool.PoolEntry", @@ -490,6 +485,18 @@ { "name":"groovy.runtime.metaclass.Script1MetaClass" }, +{ + "name":"groovy.runtime.metaclass.Script2MetaClass" +}, +{ + "name":"groovy.runtime.metaclass.Script3MetaClass" +}, +{ + "name":"groovy.runtime.metaclass.Script4MetaClass" +}, +{ + "name":"groovy.runtime.metaclass.Script5MetaClass" +}, { "name":"groovy.runtime.metaclass.groovy.lang.BindingMetaClass" }, @@ -670,7 +677,7 @@ "allDeclaredFields":true, "queryAllDeclaredMethods":true, "queryAllDeclaredConstructors":true, - "methods":[{"name":"forName","parameterTypes":["java.lang.String","boolean","java.lang.ClassLoader"] }, {"name":"getModule","parameterTypes":[] }, {"name":"getPermittedSubclasses","parameterTypes":[] }, {"name":"isSealed","parameterTypes":[] }] + "methods":[{"name":"forName","parameterTypes":["java.lang.String","boolean","java.lang.ClassLoader"] }, {"name":"getPermittedSubclasses","parameterTypes":[] }, {"name":"isSealed","parameterTypes":[] }] }, { "name":"java.lang.ClassLoader", @@ -737,10 +744,6 @@ "name":"java.lang.Math", "methods":[{"name":"floorDiv","parameterTypes":["long","long"] }, {"name":"floorMod","parameterTypes":["long","long"] }, {"name":"max","parameterTypes":["int","int"] }, {"name":"min","parameterTypes":["int","int"] }] }, -{ - "name":"java.lang.Module", - "methods":[{"name":"getDescriptor","parameterTypes":[] }] -}, { "name":"java.lang.Number", "allDeclaredFields":true, @@ -2006,7 +2009,8 @@ "allDeclaredClasses":true, "queryAllDeclaredMethods":true, "queryAllPublicMethods":true, - "queryAllDeclaredConstructors":true + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"testReadWriteSplittingInLocalTransactions","parameterTypes":[] }] }, { "name":"org.apache.shardingsphere.infra.nativetest.jdbc.features.ShadowTest", @@ -2267,7 +2271,40 @@ "name":"org.apache.shardingsphere.parser.yaml.config.YamlSQLParserRuleConfigurationCustomizer" }, { - "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.YamlReadwriteSplittingRuleConfiguration" + "name":"org.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RandomReadQueryLoadBalanceAlgorithm", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RoundRobinReadQueryLoadBalanceAlgorithm", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.WeightReadQueryLoadBalanceAlgorithm", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.YamlReadwriteSplittingRuleConfiguration", + "allDeclaredFields":true, + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSources","parameterTypes":["java.util.Map"] }] +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.YamlReadwriteSplittingRuleConfigurationBeanInfo" +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.YamlReadwriteSplittingRuleConfigurationCustomizer" +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.rule.YamlReadwriteSplittingDataSourceRuleConfiguration", + "allDeclaredFields":true, + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getLoadBalancerName","parameterTypes":[] }, {"name":"getReadDataSourceNames","parameterTypes":[] }, {"name":"getTransactionalReadQueryStrategy","parameterTypes":[] }, {"name":"getWriteDataSourceName","parameterTypes":[] }, {"name":"setReadDataSourceNames","parameterTypes":["java.util.List"] }, {"name":"setWriteDataSourceName","parameterTypes":["java.lang.String"] }] +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.rule.YamlReadwriteSplittingDataSourceRuleConfigurationBeanInfo" +}, +{ + "name":"org.apache.shardingsphere.readwritesplitting.yaml.config.rule.YamlReadwriteSplittingDataSourceRuleConfigurationCustomizer" }, { "name":"org.apache.shardingsphere.shadow.algorithm.shadow.column.ColumnRegexMatchedShadowAlgorithm", @@ -2706,30 +2743,10 @@ { "name":"org.junit.internal.AssumptionViolatedException" }, -{ - "name":"org.junit.jupiter.api.Disabled", - "queryAllPublicMethods":true -}, { "name":"org.junit.jupiter.api.Test", "queryAllPublicMethods":true }, -{ - "name":"org.junit.jupiter.api.condition.DisabledIfSystemProperty", - "queryAllPublicMethods":true -}, -{ - "name":"org.junit.jupiter.api.condition.DisabledIfSystemPropertyCondition", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"org.junit.jupiter.api.condition.DisabledInNativeImage", - "queryAllPublicMethods":true -}, -{ - "name":"org.junit.jupiter.api.extension.ExtendWith", - "queryAllPublicMethods":true -}, { "name":"org.junit.platform.commons.annotation.Testable", "queryAllPublicMethods":true @@ -2795,4 +2812,4 @@ { "name":"sun.security.x509.CertificateExtensions" } -] +] \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/resource-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/resource-config.json index 58c0bb96ac32e9..275c56d11fe8ff 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/resource-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/resource-config.json @@ -84,6 +84,10 @@ "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.manager.ContextManagerBuilder\\E" }, { "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepository\\E" + }, { + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.readwritesplitting.route.standard.filter.ReadDataSourcesFilter\\E" + }, { + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.readwritesplitting.spi.ReadQueryLoadBalanceAlgorithm\\E" }, { "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.shadow.spi.ShadowAlgorithm\\E" }, { @@ -110,26 +114,16 @@ "pattern":"\\QMETA-INF/services/org.junit.platform.engine.TestEngine\\E" }, { "pattern":"\\QMETA-INF/services/org.junit.platform.launcher.TestExecutionListener\\E" - }, { - "pattern":"\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E" - }, { - "pattern":"\\Qlogback.xml\\E" }, { "pattern":"\\Qorg/h2/util/data.zip\\E" + }, { + "pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E" }, { "pattern":"\\Qsaffron.properties\\E" }, { "pattern":"\\Qsql\\E" - }, { - "pattern":"\\Qyaml/encrypt.yaml\\E" - }, { - "pattern":"\\Qyaml/mask.yaml\\E" - }, { - "pattern":"\\Qyaml/shadow.yaml\\E" - }, { - "pattern":"\\Qyaml/sharding.yaml\\E" }, { "pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt67b/nfkc.nrm\\E" }]}, "bundles":[] -} +} \ No newline at end of file diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/serialization-config.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/serialization-config.json index fc967f7f8d99a4..495d0c61486ecd 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/serialization-config.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/shardingsphere-infra-reachability-metadata/serialization-config.json @@ -8,4 +8,4 @@ ], "proxies":[ ] -} +} \ No newline at end of file diff --git a/kernel/sql-federation/core/pom.xml b/kernel/sql-federation/core/pom.xml index c9b47b99707865..fd9da5df6573a1 100644 --- a/kernel/sql-federation/core/pom.xml +++ b/kernel/sql-federation/core/pom.xml @@ -60,13 +60,8 @@ test - com.sun.xml.bind - jaxb-core - test - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime test diff --git a/kernel/sql-federation/executor/pom.xml b/kernel/sql-federation/executor/pom.xml index c1bee817c5afeb..5d396ccfd7ed2d 100644 --- a/kernel/sql-federation/executor/pom.xml +++ b/kernel/sql-federation/executor/pom.xml @@ -80,13 +80,8 @@ test - com.sun.xml.bind - jaxb-core - test - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime test diff --git a/kernel/sql-federation/optimizer/pom.xml b/kernel/sql-federation/optimizer/pom.xml index 5a0fca9e88884c..00b744130ac49e 100644 --- a/kernel/sql-federation/optimizer/pom.xml +++ b/kernel/sql-federation/optimizer/pom.xml @@ -100,13 +100,8 @@ test - com.sun.xml.bind - jaxb-core - test - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime test diff --git a/kernel/transaction/type/xa/provider/narayana/pom.xml b/kernel/transaction/type/xa/provider/narayana/pom.xml index 5d53c349f67b19..4355af3d307f1a 100644 --- a/kernel/transaction/type/xa/provider/narayana/pom.xml +++ b/kernel/transaction/type/xa/provider/narayana/pom.xml @@ -63,12 +63,8 @@ jaxb-api - com.sun.xml.bind - jaxb-core - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime javax.activation diff --git a/mode/type/standalone/repository/provider/jdbc/pom.xml b/mode/type/standalone/repository/provider/jdbc/pom.xml index 0b81d67144e574..280ecadaf4f0a2 100644 --- a/mode/type/standalone/repository/provider/jdbc/pom.xml +++ b/mode/type/standalone/repository/provider/jdbc/pom.xml @@ -45,12 +45,8 @@ jaxb-api - com.sun.xml.bind - jaxb-core - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime javax.activation diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java index 837d5974bdbb87..609b568e021eb7 100644 --- a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java +++ b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java @@ -82,7 +82,7 @@ public static JDBCRepositorySQL load(final String type) { } /** - * Under the GraalVM Native Image corresponding to GraalVM CE 21.0.1, although there is + * Under the GraalVM Native Image corresponding to GraalVM CE 23.0.1, although there is * `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystemProvider`, the corresponding * `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` does not autoload. This is mainly to align the * behavior of `ZipFileSystemProvider`, so ShardingSphere need to manually open and close the FileSystem @@ -101,12 +101,12 @@ public static JDBCRepositorySQL load(final String type) { * @see sun.nio.fs.UnixFileSystemProvider */ private static JDBCRepositorySQL loadFromDirectory(final URL url, final String type) throws URISyntaxException, IOException { - if (null != System.getProperty("org.graalvm.nativeimage.imagecode")) { - try (FileSystem ignored = FileSystems.newFileSystem(URI.create("resource:/"), Collections.singletonMap("create", "true"))) { + if (null == System.getProperty("org.graalvm.nativeimage.imagecode") || !"runtime".equals(System.getProperty("org.graalvm.nativeimage.imagecode"))) { + return loadFromDirectoryLegacy(url, type); + } else { + try (FileSystem ignored = FileSystems.newFileSystem(URI.create("resource:/"), Collections.emptyMap())) { return loadFromDirectoryLegacy(url, type); } - } else { - return loadFromDirectoryLegacy(url, type); } } diff --git a/pom.xml b/pom.xml index 67d833c82c6871..d07f7fb3e2b677 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,8 @@ 2.3.31 1.14.8 - 2.3.0 + 2.3.1 + 2.3.1 1.3.2 1.2.0 @@ -298,17 +299,12 @@ javax.xml.bind jaxb-api - ${jaxb.version} + ${jaxb-api.version} - com.sun.xml.bind - jaxb-core - ${jaxb.version} - - - com.sun.xml.bind - jaxb-impl - ${jaxb.version} + org.glassfish.jaxb + jaxb-runtime + ${jaxb-runtime.version} javax.annotation diff --git a/test/pom.xml b/test/pom.xml index 0bd3555cb7819b..01483d29378ba3 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -56,12 +56,8 @@ jaxb-api - com.sun.xml.bind - jaxb-core - - - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime javax.activation