This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 540453f6d00 Remove useless ImportRuleConfigurationProvider's impl
(#30615)
540453f6d00 is described below
commit 540453f6d00ff4c325edcb347ae3f738f2b82021
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Mar 23 15:37:17 2024 +0800
Remove useless ImportRuleConfigurationProvider's impl (#30615)
---
.../BroadcastImportRuleConfigurationProvider.java | 37 ----------------------
...le.spi.database.ImportRuleConfigurationProvider | 18 -----------
.../SingleImportRuleConfigurationProvider.java | 37 ----------------------
...le.spi.database.ImportRuleConfigurationProvider | 18 -----------
.../YamlDatabaseConfigurationImportExecutor.java | 2 +-
5 files changed, 1 insertion(+), 111 deletions(-)
diff --git
a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/provider/BroadcastImportRuleConfigurationProvider.java
b/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/provider/BroadcastImportRuleConfigurationProvider.java
deleted file mode 100644
index 192e19ad74d..00000000000
---
a/features/broadcast/distsql/handler/src/main/java/org/apache/shardingsphere/broadcast/distsql/handler/provider/BroadcastImportRuleConfigurationProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.broadcast.distsql.handler.provider;
-
-import
org.apache.shardingsphere.broadcast.api.config.BroadcastRuleConfiguration;
-import
org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider;
-import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-
-/**
- * Broadcast import rule configuration provider.
- */
-public final class BroadcastImportRuleConfigurationProvider implements
ImportRuleConfigurationProvider<BroadcastRuleConfiguration> {
-
- @Override
- public void check(final ShardingSphereDatabase database, final
BroadcastRuleConfiguration ruleConfig) {
- }
-
- @Override
- public Class<BroadcastRuleConfiguration> getType() {
- return BroadcastRuleConfiguration.class;
- }
-}
diff --git
a/features/broadcast/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
b/features/broadcast/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
deleted file mode 100644
index cd1fe6c6ae3..00000000000
---
a/features/broadcast/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.broadcast.distsql.handler.provider.BroadcastImportRuleConfigurationProvider
diff --git
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/provider/SingleImportRuleConfigurationProvider.java
b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/provider/SingleImportRuleConfigurationProvider.java
deleted file mode 100644
index dcc7c136e47..00000000000
---
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/provider/SingleImportRuleConfigurationProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.single.distsql.handler.provider;
-
-import
org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider;
-import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.single.api.config.SingleRuleConfiguration;
-
-/**
- * Single import rule configuration provider.
- */
-public final class SingleImportRuleConfigurationProvider implements
ImportRuleConfigurationProvider<SingleRuleConfiguration> {
-
- @Override
- public void check(final ShardingSphereDatabase database, final
SingleRuleConfiguration ruleConfig) {
- }
-
- @Override
- public Class<SingleRuleConfiguration> getType() {
- return SingleRuleConfiguration.class;
- }
-}
diff --git
a/kernel/single/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
b/kernel/single/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
deleted file mode 100644
index ecea9ee9d59..00000000000
---
a/kernel/single/distsql/handler/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.engine.update.ral.rule.spi.database.ImportRuleConfigurationProvider
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.single.distsql.handler.provider.SingleImportRuleConfigurationProvider
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
index 407b8858e79..622af678883 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/YamlDatabaseConfigurationImportExecutor.java
@@ -142,7 +142,7 @@ public final class YamlDatabaseConfigurationImportExecutor {
@SuppressWarnings("unchecked")
private void addRule(final Collection<RuleConfiguration> ruleConfigs,
final RuleConfiguration ruleConfig, final ShardingSphereDatabase database) {
- TypedSPILoader.getService(ImportRuleConfigurationProvider.class,
ruleConfig.getClass()).check(database, ruleConfig);
+ TypedSPILoader.findService(ImportRuleConfigurationProvider.class,
ruleConfig.getClass()).ifPresent(optional -> optional.check(database,
ruleConfig));
ruleConfigs.add(ruleConfig);
database.getRuleMetaData().getRules().add(buildRule(ruleConfig,
database));
}