From af4d881081a4b62f7f2eab8cbc6cc02330fc6b46 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 21 Dec 2024 20:55:26 +0800 Subject: [PATCH] Move GlobalLockNames to mode-core module (#34114) --- .../scenario/migration/preparer/MigrationJobPreparer.java | 2 +- .../globalclock/executor/GlobalClockTransactionHook.java | 2 +- .../shardingsphere/mode/lock/global}/GlobalLockNames.java | 5 ++++- .../refresher/ShardingSphereStatisticsRefreshEngine.java | 2 +- .../handler/distsql/ral/updatable/LockClusterExecutor.java | 2 +- .../handler/distsql/ral/updatable/UnlockClusterExecutor.java | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) rename {infra/common/src/main/java/org/apache/shardingsphere/infra/lock => mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global}/GlobalLockNames.java (93%) diff --git a/kernel/data-pipeline/scenario/migration/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.java b/kernel/data-pipeline/scenario/migration/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.java index 77a1ed49a710c..3f07a53380f02 100644 --- a/kernel/data-pipeline/scenario/migration/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.java +++ b/kernel/data-pipeline/scenario/migration/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.java @@ -65,7 +65,7 @@ import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.exception.generic.UnsupportedSQLOperationException; -import org.apache.shardingsphere.infra.lock.GlobalLockNames; +import org.apache.shardingsphere.mode.lock.global.GlobalLockNames; import org.apache.shardingsphere.infra.lock.LockContext; import org.apache.shardingsphere.infra.lock.LockDefinition; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; diff --git a/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/executor/GlobalClockTransactionHook.java b/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/executor/GlobalClockTransactionHook.java index 8d5e9c7b93aee..295d2f1beb8df 100644 --- a/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/executor/GlobalClockTransactionHook.java +++ b/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/executor/GlobalClockTransactionHook.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.globalclock.rule.constant.GlobalClockOrder; import org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; -import org.apache.shardingsphere.infra.lock.GlobalLockNames; +import org.apache.shardingsphere.mode.lock.global.GlobalLockNames; import org.apache.shardingsphere.infra.lock.LockContext; import org.apache.shardingsphere.infra.lock.LockDefinition; import org.apache.shardingsphere.infra.session.connection.transaction.TransactionConnectionContext; diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/GlobalLockNames.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockNames.java similarity index 93% rename from infra/common/src/main/java/org/apache/shardingsphere/infra/lock/GlobalLockNames.java rename to mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockNames.java index 24e7da3605065..1656c137889e3 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/lock/GlobalLockNames.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockNames.java @@ -15,11 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.infra.lock; +package org.apache.shardingsphere.mode.lock.global; import lombok.Getter; import lombok.RequiredArgsConstructor; +/** + * Global lock names. + */ @RequiredArgsConstructor @Getter public enum GlobalLockNames { diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/ShardingSphereStatisticsRefreshEngine.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/ShardingSphereStatisticsRefreshEngine.java index 9730c6bd5ffc8..28457721b475c 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/ShardingSphereStatisticsRefreshEngine.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/ShardingSphereStatisticsRefreshEngine.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey; import org.apache.shardingsphere.infra.executor.kernel.thread.ExecutorThreadFactoryBuilder; -import org.apache.shardingsphere.infra.lock.GlobalLockNames; +import org.apache.shardingsphere.mode.lock.global.GlobalLockNames; import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java index 52e4f65591daf..075b9ada22656 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.algorithm.core.exception.MissingRequiredAlgorithmException; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.exception.core.external.sql.identifier.SQLExceptionIdentifier; -import org.apache.shardingsphere.infra.lock.GlobalLockNames; +import org.apache.shardingsphere.mode.lock.global.GlobalLockNames; import org.apache.shardingsphere.infra.lock.LockContext; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.infra.state.cluster.ClusterState; diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java index ff314edf85c1b..318311e4dc2fa 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.distsql.handler.required.DistSQLExecutorClusterModeRequired; import org.apache.shardingsphere.distsql.statement.ral.updatable.UnlockClusterStatement; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; -import org.apache.shardingsphere.infra.lock.GlobalLockNames; +import org.apache.shardingsphere.mode.lock.global.GlobalLockNames; import org.apache.shardingsphere.infra.lock.LockContext; import org.apache.shardingsphere.infra.state.cluster.ClusterState; import org.apache.shardingsphere.mode.exception.NotLockedClusterException;