You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/10/14 08:10:22 UTC

[shardingsphere] branch master updated: Remove distributed lock useless code (#21557)

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 d3fdca3a2d8 Remove distributed lock useless code (#21557)
d3fdca3a2d8 is described below

commit d3fdca3a2d8f97c27c8d394f5ec0dfccd4810c86
Author: gin <ja...@163.com>
AuthorDate: Fri Oct 14 16:10:12 2022 +0800

    Remove distributed lock useless code (#21557)
---
 .../infra/lock/ShardingSphereLock.java             | 40 ----------------------
 .../infra/lock/exception/LockSQLException.java     | 35 -------------------
 .../exception/TableLockWaitTimeoutException.java   | 32 -----------------
 .../infra/lock/exception/TableLockedException.java | 32 -----------------
 4 files changed, 139 deletions(-)

diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/ShardingSphereLock.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/ShardingSphereLock.java
deleted file mode 100644
index da3af5fc7bf..00000000000
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/ShardingSphereLock.java
+++ /dev/null
@@ -1,40 +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.infra.lock;
-
-/**
- * ShardingSphere lock.
- */
-public interface ShardingSphereLock {
-    
-    /**
-     * Try to lock with time out.
-     *
-     * @param lockName lock name
-     * @param timeoutMillis the maximum time in milliseconds to acquire lock
-     * @return true if get the lock, false if not
-     */
-    boolean tryLock(String lockName, long timeoutMillis);
-    
-    /**
-     * Unlock.
-     *
-     * @param lockName lock name
-     */
-    void unlock(String lockName);
-}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/LockSQLException.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/LockSQLException.java
deleted file mode 100644
index 530e7c9a62a..00000000000
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/LockSQLException.java
+++ /dev/null
@@ -1,35 +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.infra.lock.exception;
-
-import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.SQLState;
-import org.apache.shardingsphere.infra.util.exception.external.sql.type.kernel.KernelSQLException;
-
-/**
- * Lock SQL exception.
- */
-public abstract class LockSQLException extends KernelSQLException {
-    
-    private static final long serialVersionUID = 7889797502163128147L;
-    
-    private static final int KERNEL_CODE = 5;
-    
-    public LockSQLException(final SQLState sqlState, final int errorCode, final String reason, final Object... messageArguments) {
-        super(sqlState, KERNEL_CODE, errorCode, reason, messageArguments);
-    }
-}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockWaitTimeoutException.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockWaitTimeoutException.java
deleted file mode 100644
index 391cc88b607..00000000000
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockWaitTimeoutException.java
+++ /dev/null
@@ -1,32 +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.infra.lock.exception;
-
-import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.XOpenSQLState;
-
-/**
- * Table lock wait timeout exception.
- */
-public final class TableLockWaitTimeoutException extends LockSQLException {
-    
-    private static final long serialVersionUID = 2599713085782288003L;
-    
-    public TableLockWaitTimeoutException(final String schemaName, final String tableName, final long timeoutMilliseconds) {
-        super(XOpenSQLState.GENERAL_ERROR, 1, "The table `%s` of schema `%s` lock wait timeout of `%s` milliseconds exceeded.", tableName, schemaName, String.valueOf(timeoutMilliseconds));
-    }
-}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockedException.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockedException.java
deleted file mode 100644
index 0ca44eddaff..00000000000
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/exception/TableLockedException.java
+++ /dev/null
@@ -1,32 +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.infra.lock.exception;
-
-import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.XOpenSQLState;
-
-/**
- * Table locked exception.
- */
-public final class TableLockedException extends LockSQLException {
-    
-    private static final long serialVersionUID = 2622020743612706932L;
-    
-    public TableLockedException(final String databaseName, final String schemaName, final String tableNames) {
-        super(XOpenSQLState.GENERAL_ERROR, 0, "The table `%s` of schema `%s` is locked in database `%s`.", tableNames, schemaName, databaseName);
-    }
-}