This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 50a800e5c88 Remove useless CacheableShardingAlgorithmClassProvider
(#36322)
50a800e5c88 is described below
commit 50a800e5c88ffe1bf0898a13f0553215bec52666
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Aug 17 14:00:44 2025 +0800
Remove useless CacheableShardingAlgorithmClassProvider (#36322)
---
.../CacheableShardingAlgorithmChecker.java | 18 ++++------
.../CacheableShardingAlgorithmClassProvider.java | 36 --------------------
...tInCacheableShardingAlgorithmClassProvider.java | 39 ----------------------
...gorithm.CacheableShardingAlgorithmClassProvider | 18 ----------
4 files changed, 7 insertions(+), 104 deletions(-)
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmChecker.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmChecker.java
index ae0cdcad062..c4a4e46647f 100644
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmChecker.java
+++
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmChecker.java
@@ -19,11 +19,14 @@ package
org.apache.shardingsphere.sharding.cache.checker.algorithm;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
+import
org.apache.shardingsphere.sharding.algorithm.sharding.mod.HashModShardingAlgorithm;
+import
org.apache.shardingsphere.sharding.algorithm.sharding.mod.ModShardingAlgorithm;
+import
org.apache.shardingsphere.sharding.algorithm.sharding.range.BoundaryBasedRangeShardingAlgorithm;
+import
org.apache.shardingsphere.sharding.algorithm.sharding.range.VolumeBasedRangeShardingAlgorithm;
import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
+import java.util.Arrays;
import java.util.Collection;
-import java.util.HashSet;
/**
* Cacheable sharding algorithm checker.
@@ -31,15 +34,8 @@ import java.util.HashSet;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class CacheableShardingAlgorithmChecker {
- private static final Collection<Class<? extends ShardingAlgorithm>>
CACHEABLE_SHARDING_ALGORITHM_CLASSES;
-
- static {
- Collection<Class<? extends ShardingAlgorithm>> result = new
HashSet<>();
- for (CacheableShardingAlgorithmClassProvider each :
ShardingSphereServiceLoader.getServiceInstances(CacheableShardingAlgorithmClassProvider.class))
{
- result.addAll(each.getCacheableShardingAlgorithmClasses());
- }
- CACHEABLE_SHARDING_ALGORITHM_CLASSES = result;
- }
+ private static final Collection<Class<? extends ShardingAlgorithm>>
CACHEABLE_SHARDING_ALGORITHM_CLASSES = Arrays.asList(
+ ModShardingAlgorithm.class, HashModShardingAlgorithm.class,
VolumeBasedRangeShardingAlgorithm.class,
BoundaryBasedRangeShardingAlgorithm.class);
/**
* Check if sharding algorithm is cacheable.
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmClassProvider.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmClassProvider.java
deleted file mode 100644
index dd6e49ca4a1..00000000000
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/CacheableShardingAlgorithmClassProvider.java
+++ /dev/null
@@ -1,36 +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.sharding.cache.checker.algorithm;
-
-import org.apache.shardingsphere.infra.spi.ShardingSphereSPI;
-import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
-
-import java.util.Collection;
-
-/**
- * Cacheable sharding algorithm class provider.
- */
-public interface CacheableShardingAlgorithmClassProvider extends
ShardingSphereSPI {
-
- /**
- * Get classes of cacheable sharding algorithm.
- *
- * @return classes of cacheable sharding algorithm.
- */
- Collection<Class<? extends ShardingAlgorithm>>
getCacheableShardingAlgorithmClasses();
-}
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/impl/BuiltInCacheableShardingAlgorithmClassProvider.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/impl/BuiltInCacheableShardingAlgorithmClassProvider.java
deleted file mode 100644
index 0072a5f1b83..00000000000
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/cache/checker/algorithm/impl/BuiltInCacheableShardingAlgorithmClassProvider.java
+++ /dev/null
@@ -1,39 +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.sharding.cache.checker.algorithm.impl;
-
-import
org.apache.shardingsphere.sharding.algorithm.sharding.mod.HashModShardingAlgorithm;
-import
org.apache.shardingsphere.sharding.algorithm.sharding.mod.ModShardingAlgorithm;
-import
org.apache.shardingsphere.sharding.algorithm.sharding.range.BoundaryBasedRangeShardingAlgorithm;
-import
org.apache.shardingsphere.sharding.algorithm.sharding.range.VolumeBasedRangeShardingAlgorithm;
-import
org.apache.shardingsphere.sharding.cache.checker.algorithm.CacheableShardingAlgorithmClassProvider;
-import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Built-in cacheable sharding algorithm class provider.
- */
-public final class BuiltInCacheableShardingAlgorithmClassProvider implements
CacheableShardingAlgorithmClassProvider {
-
- @Override
- public Collection<Class<? extends ShardingAlgorithm>>
getCacheableShardingAlgorithmClasses() {
- return Arrays.asList(ModShardingAlgorithm.class,
HashModShardingAlgorithm.class, VolumeBasedRangeShardingAlgorithm.class,
BoundaryBasedRangeShardingAlgorithm.class);
- }
-}
diff --git
a/features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.cache.checker.algorithm.CacheableShardingAlgorithmClassProvider
b/features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.cache.checker.algorithm.CacheableShardingAlgorithmClassProvider
deleted file mode 100644
index b733daceea9..00000000000
---
a/features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sharding.cache.checker.algorithm.CacheableShardingAlgorithmClassProvider
+++ /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.sharding.cache.checker.algorithm.impl.BuiltInCacheableShardingAlgorithmClassProvider