Skip to content

Commit

Permalink
Add GraalVM Reachability Metadata and corresponding nativeTest for Zo…
Browse files Browse the repository at this point in the history
…okeeper integration
  • Loading branch information
linghengqian committed Dec 17, 2023
1 parent 436684d commit 1e0cbff
Show file tree
Hide file tree
Showing 9 changed files with 330 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name":"org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfigurationCustomizer"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.state.datasource.DataSourceStateManager"},
"condition":{"typeReachable":"org.apache.shardingsphere.infra.database.DatabaseTypeEngine"},
"name":"org.apache.shardingsphere.driver.ShardingSphereDriver"
},
{
Expand Down Expand Up @@ -136,12 +136,27 @@
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"},
"name":"org.apache.shardingsphere.globalclock.core.yaml.config.YamlGlobalClockRuleConfiguration"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.service.ComputeNodeStatusService"},
"name":"org.apache.shardingsphere.infra.instance.ComputeNodeData",
"allDeclaredFields":true,
"queryAllPublicMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getAttribute","parameterTypes":[] }, {"name":"getVersion","parameterTypes":[] }, {"name":"setAttribute","parameterTypes":["java.lang.String"] }, {"name":"setVersion","parameterTypes":["java.lang.String"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.service.ComputeNodeStatusService"},
"name":"org.apache.shardingsphere.infra.instance.ComputeNodeDataBeanInfo"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.service.ComputeNodeStatusService"},
"name":"org.apache.shardingsphere.infra.instance.ComputeNodeDataCustomizer"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheBuilder"},
"name":"org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlAlgorithmConfiguration"},
"condition":{"typeReachable":"org.apache.shardingsphere.encrypt.yaml.swapper.NewYamlEncryptRuleConfigurationSwapper"},
"name":"org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlAlgorithmConfiguration",
"allDeclaredFields":true,
"queryAllPublicMethods":true,
Expand Down Expand Up @@ -174,12 +189,8 @@
"condition":{"typeReachable":"org.apache.shardingsphere.infra.util.yaml.YamlEngine"},
"name":"org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"setType","parameterTypes":["java.lang.String"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration"},
"name":"org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration",
"queryAllPublicMethods":true
"queryAllPublicMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }, {"name":"setType","parameterTypes":["java.lang.String"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfigurationBeanInfo"},
Expand Down Expand Up @@ -210,7 +221,7 @@
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn",
"allDeclaredFields":true,
"queryAllPublicMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getDataType","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"isCaseSensitive","parameterTypes":[] }, {"name":"isGenerated","parameterTypes":[] }, {"name":"isNullable","parameterTypes":[] }, {"name":"isPrimaryKey","parameterTypes":[] }, {"name":"isUnsigned","parameterTypes":[] }, {"name":"isVisible","parameterTypes":[] }, {"name":"setCaseSensitive","parameterTypes":["boolean"] }, {"name":"setDataType","parameterTypes":["int"] }, {"name":"setGenerated","parameterTypes":["boolean"] }, {"name":"setName","parameterTypes":["java.lang.String"] }, {"name":"setPrimaryKey","parameterTypes":["boolean"] }, {"name":"setUnsigned","parameterTypes":["boolean"] }, {"name":"setVisible","parameterTypes":["boolean"] }]
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getDataType","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"isCaseSensitive","parameterTypes":[] }, {"name":"isGenerated","parameterTypes":[] }, {"name":"isNullable","parameterTypes":[] }, {"name":"isPrimaryKey","parameterTypes":[] }, {"name":"isUnsigned","parameterTypes":[] }, {"name":"isVisible","parameterTypes":[] }, {"name":"setCaseSensitive","parameterTypes":["boolean"] }, {"name":"setDataType","parameterTypes":["int"] }, {"name":"setGenerated","parameterTypes":["boolean"] }, {"name":"setName","parameterTypes":["java.lang.String"] }, {"name":"setNullable","parameterTypes":["boolean"] }, {"name":"setPrimaryKey","parameterTypes":["boolean"] }, {"name":"setUnsigned","parameterTypes":["boolean"] }, {"name":"setVisible","parameterTypes":["boolean"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumnBeanInfo"},
Expand All @@ -225,7 +236,7 @@
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
"allDeclaredFields":true,
"queryAllPublicMethods":true,
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getColumns","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"isUnique","parameterTypes":[] }, {"name":"setName","parameterTypes":["java.lang.String"] }]
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"getColumns","parameterTypes":[] }, {"name":"getName","parameterTypes":[] }, {"name":"isUnique","parameterTypes":[] }, {"name":"setName","parameterTypes":["java.lang.String"] }, {"name":"setUnique","parameterTypes":["boolean"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndexBeanInfo"},
Expand All @@ -236,7 +247,7 @@
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndexCustomizer"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.metadata.persist.service.schema.NewTableMetaDataPersistService"},
"condition":{"typeReachable":"org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilder"},
"name":"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable",
"allDeclaredFields":true,
"queryAllPublicMethods":true,
Expand Down Expand Up @@ -359,16 +370,73 @@
"condition":{"typeReachable":"org.apache.shardingsphere.mask.yaml.config.rule.YamlMaskTableRuleConfigurationCustomizer"},
"name":"org.apache.shardingsphere.mask.yaml.config.rule.YamlMaskTableRuleConfigurationCustomizer"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.ShardingSphereSchemaDataRegistrySubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.ShardingSphereSchemaDataRegistrySubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ClusterProcessSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ClusterProcessSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.NewProcessListChangedSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.NewProcessListChangedSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.cluster.subscriber.ClusterStatusSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.cluster.subscriber.ClusterStatusSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.subscriber.NewComputeNodeStatusSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.subscriber.NewComputeNodeStatusSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.subscriber.StorageNodeStatusSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.subscriber.StorageNodeStatusSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.CacheEvictedSubscriber",
"queryAllDeclaredMethods":true,
"methods":[{"name":"onGovernanceEvent","parameterTypes":["org.apache.shardingsphere.infra.rule.event.GovernanceEvent"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.DatabaseChangedSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.DatabaseChangedSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.util.eventbus.EventBusContext"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.NewResourceMetaDataChangedSubscriber",
"queryAllDeclaredMethods":true,
"methods":[{"name":"renew","parameterTypes":["org.apache.shardingsphere.mode.event.schema.table.AlterTableEvent"] }, {"name":"renew","parameterTypes":["org.apache.shardingsphere.mode.event.schema.table.DropTableEvent"] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.NewStateChangedSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber.NewStateChangedSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.subscriber.StandaloneProcessSubscriber"},
"name":"org.apache.shardingsphere.mode.manager.standalone.subscriber.StandaloneProcessSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.subscriber.StandaloneProcessSubscriber"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ClusterProcessSubscriber"},
"name":"org.apache.shardingsphere.mode.process.ProcessSubscriber",
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"name":"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder"},
"name":"org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository",
Expand All @@ -386,7 +454,7 @@
"queryAllDeclaredMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"name":"org.apache.shardingsphere.mode.subsciber.RuleItemChangedSubscriber",
"queryAllDeclaredMethods":true
},
Expand Down Expand Up @@ -688,22 +756,18 @@
"name":"org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlStandardShardingStrategyConfigurationCustomizer"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfiguration"},
"name":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfiguration",
"queryAllPublicMethods":true
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.single.yaml.config.swapper.NewYamlSingleRuleConfigurationSwapper"},
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"},
"name":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfiguration",
"queryAllPublicMethods":true,
"allDeclaredFields":true,
"methods":[{"name":"getDefaultDataSource","parameterTypes":[] }, {"name":"getTables","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfigurationBeanInfo"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"name":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfigurationBeanInfo"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfigurationCustomizer"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"name":"org.apache.shardingsphere.single.yaml.config.pojo.YamlSingleRuleConfigurationCustomizer"
},
{
Expand Down Expand Up @@ -876,7 +940,12 @@
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sqlfederation.rule.SQLFederationRule"},
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.type.SQLServerDMLStatementVisitor"},
"name":"org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.type.SQLServerDMLStatementVisitor",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sqlfederation.rule.builder.SQLFederationRuleBuilder"},
"name":"org.apache.shardingsphere.sqlfederation.optimizer.planner.util.SQLFederationFunctionUtils",
"queryAllPublicMethods":true
},
Expand All @@ -900,10 +969,5 @@
{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.yaml.config.shortcut.YamlRuleConfigurationShortcuts"},
"name":"org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration"
},
{
"condition":{"typeReachable":"org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.type.SQLServerDMLStatementVisitor"},
"name":"org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.type.SQLServerDMLStatementVisitor",
"methods":[{"name":"<init>","parameterTypes":[] }]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"},
"pattern":".*sql/.+\\.xml$"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.driver.ShardingSphereDriver"},
"condition":{"typeReachable":"org.apache.shardingsphere.infra.state.datasource.DataSourceStateManager"},
"pattern":"\\QMETA-INF/services/java.sql.Driver\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.authority.spi.AuthorityRegistryProvider\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
Expand Down Expand Up @@ -64,7 +64,7 @@
"condition":{"typeReachable":"org.apache.shardingsphere.infra.metadata.database.schema.builder.GenericSchemaBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.metadata.database.schema.reviser.MetaDataReviseEntry\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.infra.metadata.statistics.builder.ShardingSphereStatisticsBuilder\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.rewrite.SQLRewriteEntry"},
Expand Down Expand Up @@ -102,9 +102,21 @@
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.manager.ContextManagerBuilder\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.NewGovernanceWatcherFactory"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.NewGovernanceWatcher\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.cluster.lock.holder.DistributedLockHolder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepository\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.mode.metadata.builder.RuleConfigurationEventBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.mode.spi.RuleNodePathProvider\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.readwritesplitting.route.standard.StandardReadwriteSplittingDataSourceRouter"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.readwritesplitting.route.standard.filter.ReadDataSourcesFilter\\E"
Expand All @@ -127,7 +139,7 @@
"condition":{"typeReachable":"org.apache.shardingsphere.sqltranslator.rule.SQLTranslatorRule"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.sqltranslator.spi.SQLTranslator\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader"},
"condition":{"typeReachable":"org.apache.shardingsphere.mode.manager.cluster.NewClusterContextManagerBuilder"},
"pattern":"\\QMETA-INF/services/org.apache.shardingsphere.timeservice.spi.TimestampService\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader"},
Expand Down
2 changes: 2 additions & 0 deletions test/native/native-image-filter/extra-filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
{"excludeClasses": "com.github.dockerjava.api.**"},
{"excludeClasses": "com.google.common.util.concurrent.**"},
{"excludeClasses": "com.ibm.icu.text.**"},
{"excludeClasses": "com.microsoft.sqlserver.jdbc.**"},
{"excludeClasses": "com.mysql.cj.**"},
{"excludeClasses": "com.zaxxer.hikari.**"},
{"excludeClasses": "javax.xml.**"},
{"excludeClasses": "groovy.**"},
{"excludeClasses": "org.apache.calcite.**"},
{"excludeClasses": "org.apache.zookeeper.**"},
{"excludeClasses": "org.codehaus.groovy.**"},
{"excludeClasses": "org.h2.**"},
{"excludeClasses": "org.locationtech.jts.geom.**"},
Expand Down
7 changes: 4 additions & 3 deletions test/native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-cluster-mode-repository-zookeeper</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down
Loading

0 comments on commit 1e0cbff

Please sign in to comment.