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 cc2eb955746 Remove DistributedLockCreator (#35113)
cc2eb955746 is described below
commit cc2eb955746a7aaa44237667610f8f3ea14db687
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Mar 31 16:22:45 2025 +0800
Remove DistributedLockCreator (#35113)
---
.../lock/creator/DistributedLockCreator.java | 43 ----------------------
.../core/lock/DefaultDistributedLockCreator.java | 39 --------------------
...ory.cluster.lock.creator.DistributedLockCreator | 18 ---------
.../etcd/lock/EtcdDistributedLockCreator.java | 39 --------------------
...ory.cluster.lock.creator.DistributedLockCreator | 18 ---------
.../lock/ZooKeeperDistributedLockCreator.java | 39 --------------------
...ory.cluster.lock.creator.DistributedLockCreator | 18 ---------
7 files changed, 214 deletions(-)
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
deleted file mode 100644
index 71991442905..00000000000
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/lock/creator/DistributedLockCreator.java
+++ /dev/null
@@ -1,43 +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.mode.repository.cluster.lock.creator;
-
-import org.apache.shardingsphere.infra.props.TypedProperties;
-import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
-import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
-
-/**
- * Distributed lock creator.
- *
- * @param <C> type of distributed lock client
- * @param <P> type of typed properties
- */
-@SingletonSPI
-public interface DistributedLockCreator<C, P extends TypedProperties<?>>
extends TypedSPI {
-
- /**
- * Create distributed lock.
- *
- * @param lockKey lock key
- * @param client client
- * @param props props
- * @return created distributed lock
- */
- DistributedLock create(String lockKey, C client, P props);
-}
diff --git
a/mode/type/cluster/repository/core/src/main/java/org/apache/shardingsphere/mode/repository/cluster/core/lock/DefaultDistributedLockCreator.java
b/mode/type/cluster/repository/core/src/main/java/org/apache/shardingsphere/mode/repository/cluster/core/lock/DefaultDistributedLockCreator.java
deleted file mode 100644
index 99f9a42f5e1..00000000000
---
a/mode/type/cluster/repository/core/src/main/java/org/apache/shardingsphere/mode/repository/cluster/core/lock/DefaultDistributedLockCreator.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.mode.repository.cluster.core.lock;
-
-import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
-import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
-import
org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator;
-import
org.apache.shardingsphere.mode.repository.cluster.core.lock.props.DefaultLockTypedProperties;
-
-/**
- * Default distributed lock creator.
- */
-public final class DefaultDistributedLockCreator implements
DistributedLockCreator<ClusterPersistRepository, DefaultLockTypedProperties> {
-
- @Override
- public DistributedLock create(final String lockKey, final
ClusterPersistRepository client, final DefaultLockTypedProperties props) {
- return new DefaultDistributedLock(lockKey, client, props);
- }
-
- @Override
- public String getType() {
- return "default";
- }
-}
diff --git
a/mode/type/cluster/repository/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
b/mode/type/cluster/repository/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
deleted file mode 100644
index a12a2147e0b..00000000000
---
a/mode/type/cluster/repository/core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
+++ /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.mode.repository.cluster.core.lock.DefaultDistributedLockCreator
diff --git
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/lock/EtcdDistributedLockCreator.java
b/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/lock/EtcdDistributedLockCreator.java
deleted file mode 100644
index fe629e3597c..00000000000
---
a/mode/type/cluster/repository/provider/etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/lock/EtcdDistributedLockCreator.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.mode.repository.cluster.etcd.lock;
-
-import io.etcd.jetcd.Client;
-import
org.apache.shardingsphere.mode.repository.cluster.etcd.props.EtcdProperties;
-import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
-import
org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator;
-
-/**
- * Etcd distributed lock creator.
- */
-public final class EtcdDistributedLockCreator implements
DistributedLockCreator<Client, EtcdProperties> {
-
- @Override
- public DistributedLock create(final String lockKey, final Client client,
final EtcdProperties props) {
- return new EtcdDistributedLock(lockKey, client, props);
- }
-
- @Override
- public String getType() {
- return "etcd";
- }
-}
diff --git
a/mode/type/cluster/repository/provider/etcd/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
b/mode/type/cluster/repository/provider/etcd/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
deleted file mode 100644
index 6765fd5d9fd..00000000000
---
a/mode/type/cluster/repository/provider/etcd/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
+++ /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.mode.repository.cluster.etcd.lock.EtcdDistributedLockCreator
diff --git
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/lock/ZooKeeperDistributedLockCreator.java
b/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/lock/ZooKeeperDistributedLockCreator.java
deleted file mode 100644
index ff14aa5e41e..00000000000
---
a/mode/type/cluster/repository/provider/zookeeper/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/lock/ZooKeeperDistributedLockCreator.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.mode.repository.cluster.zookeeper.lock;
-
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.shardingsphere.mode.repository.cluster.lock.DistributedLock;
-import
org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator;
-import
org.apache.shardingsphere.mode.repository.cluster.zookeeper.props.ZookeeperProperties;
-
-/**
- * ZooKeeper distributed lock creator.
- */
-public final class ZooKeeperDistributedLockCreator implements
DistributedLockCreator<CuratorFramework, ZookeeperProperties> {
-
- @Override
- public DistributedLock create(final String lockKey, final CuratorFramework
client, final ZookeeperProperties props) {
- return new ZookeeperDistributedLock(lockKey, client);
- }
-
- @Override
- public String getType() {
- return "ZooKeeper";
- }
-}
diff --git
a/mode/type/cluster/repository/provider/zookeeper/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
b/mode/type/cluster/repository/provider/zookeeper/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
deleted file mode 100644
index 8cf882a6d31..00000000000
---
a/mode/type/cluster/repository/provider/zookeeper/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.lock.creator.DistributedLockCreator
+++ /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.mode.repository.cluster.zookeeper.lock.ZooKeeperDistributedLockCreator