This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 0d99eab Add SPI register for rdl handler (#10473)
0d99eab is described below
commit 0d99eab84f31f962593f848e33c88ec1f4b2abe5
Author: Haoran Meng <[email protected]>
AuthorDate: Wed May 26 11:34:07 2021 +0800
Add SPI register for rdl handler (#10473)
Co-authored-by: menghaoranss <[email protected]>
---
.../distsql/rdl/impl/AlterDatabaseDiscoveryRuleBackendHandler.java | 5 +++++
.../text/distsql/rdl/impl/AlterEncryptRuleBackendHandler.java | 5 +++++
.../rdl/impl/AlterReadwriteSplittingRuleBackendHandler.java | 5 +++++
.../rdl/impl/CreateDatabaseDiscoveryRuleBackendHandler.java | 5 +++++
.../text/distsql/rdl/impl/CreateEncryptRuleBackendHandler.java | 5 +++++
.../rdl/impl/CreateReadwriteSplittingRuleBackendHandler.java | 7 ++++++-
6 files changed, 31 insertions(+), 1 deletion(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterDatabaseDiscoveryRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterDatabaseDiscoveryRuleBackendHandler.java
index a90478f..bcb4a42 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterDatabaseDiscoveryRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterDatabaseDiscoveryRuleBackendHandler.java
@@ -27,6 +27,7 @@ import
org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterDatabas
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -52,6 +53,10 @@ import java.util.stream.Collectors;
*/
public final class AlterDatabaseDiscoveryRuleBackendHandler extends
SchemaRequiredBackendHandler<AlterDatabaseDiscoveryRuleStatement> {
+ static {
+ ShardingSphereServiceLoader.register(DatabaseDiscoveryType.class);
+ }
+
public AlterDatabaseDiscoveryRuleBackendHandler(final
AlterDatabaseDiscoveryRuleStatement sqlStatement, final BackendConnection
backendConnection) {
super(sqlStatement, backendConnection);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterEncryptRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterEncryptRuleBackendHandler.java
index 99a6eea..62bbc5a 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterEncryptRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterEncryptRuleBackendHandler.java
@@ -27,6 +27,7 @@ import
org.apache.shardingsphere.encrypt.yaml.converter.EncryptRuleStatementConv
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -49,6 +50,10 @@ import java.util.stream.Collectors;
*/
public final class AlterEncryptRuleBackendHandler extends
SchemaRequiredBackendHandler<AlterEncryptRuleStatement> {
+ static {
+ ShardingSphereServiceLoader.register(EncryptAlgorithm.class);
+ }
+
public AlterEncryptRuleBackendHandler(final AlterEncryptRuleStatement
sqlStatement, final BackendConnection backendConnection) {
super(sqlStatement, backendConnection);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterReadwriteSplittingRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterReadwriteSplittingRuleBackendHandler.java
index 9345dbc..67f2621 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterReadwriteSplittingRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/AlterReadwriteSplittingRuleBackendHandler.java
@@ -23,6 +23,7 @@ import
org.apache.shardingsphere.distsql.parser.statement.rdl.alter.AlterReadwri
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -53,6 +54,10 @@ import java.util.stream.Collectors;
*/
public final class AlterReadwriteSplittingRuleBackendHandler extends
SchemaRequiredBackendHandler<AlterReadwriteSplittingRuleStatement> {
+ static {
+
ShardingSphereServiceLoader.register(ReplicaLoadBalanceAlgorithm.class);
+ }
+
public AlterReadwriteSplittingRuleBackendHandler(final
AlterReadwriteSplittingRuleStatement sqlStatement, final BackendConnection
backendConnection) {
super(sqlStatement, backendConnection);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateDatabaseDiscoveryRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateDatabaseDiscoveryRuleBackendHandler.java
index b9c9b1e..b8f6c0a 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateDatabaseDiscoveryRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateDatabaseDiscoveryRuleBackendHandler.java
@@ -25,6 +25,7 @@ import
org.apache.shardingsphere.distsql.parser.statement.rdl.create.impl.Create
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -48,6 +49,10 @@ import java.util.stream.Collectors;
*/
public final class CreateDatabaseDiscoveryRuleBackendHandler extends
SchemaRequiredBackendHandler<CreateDatabaseDiscoveryRuleStatement> {
+ static {
+ ShardingSphereServiceLoader.register(DatabaseDiscoveryType.class);
+ }
+
public CreateDatabaseDiscoveryRuleBackendHandler(final
CreateDatabaseDiscoveryRuleStatement sqlStatement, final BackendConnection
backendConnection) {
super(sqlStatement, backendConnection);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateEncryptRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateEncryptRuleBackendHandler.java
index e65e35a..ecc685c 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateEncryptRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateEncryptRuleBackendHandler.java
@@ -25,6 +25,7 @@ import
org.apache.shardingsphere.encrypt.yaml.converter.EncryptRuleStatementConv
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -46,6 +47,10 @@ import java.util.stream.Collectors;
*/
public final class CreateEncryptRuleBackendHandler extends
SchemaRequiredBackendHandler<CreateEncryptRuleStatement> {
+ static {
+ ShardingSphereServiceLoader.register(EncryptAlgorithm.class);
+ }
+
public CreateEncryptRuleBackendHandler(final CreateEncryptRuleStatement
sqlStatement, final BackendConnection backendConnection) {
super(sqlStatement, backendConnection);
}
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateReadwriteSplittingRuleBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateReadwriteSplittingRuleBackendHandler.java
index d6d4759..36a9ef4 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateReadwriteSplittingRuleBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateReadwriteSplittingRuleBackendHandler.java
@@ -22,6 +22,7 @@ import
org.apache.shardingsphere.distsql.parser.statement.rdl.create.impl.Create
import
org.apache.shardingsphere.governance.core.registry.listener.event.rule.RuleConfigurationsAlteredEvent;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
+import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
import
org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -48,7 +49,11 @@ import java.util.stream.Collectors;
* Create readwrite splitting rule backend handler.
*/
public final class CreateReadwriteSplittingRuleBackendHandler extends
SchemaRequiredBackendHandler<CreateReadwriteSplittingRuleStatement> {
-
+
+ static {
+
ShardingSphereServiceLoader.register(ReplicaLoadBalanceAlgorithm.class);
+ }
+
public CreateReadwriteSplittingRuleBackendHandler(final
CreateReadwriteSplittingRuleStatement sqlStatement, final BackendConnection
backendConnection) {
super(sqlStatement, backendConnection);
}