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 2025/02/08 17:16:18 UTC
(shardingsphere) branch master updated: Remove MetaDataVersionPersistService.switchActiveVersion (#34616)
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 49253f652e2 Remove MetaDataVersionPersistService.switchActiveVersion (#34616)
49253f652e2 is described below
commit 49253f652e2fe2cc1cfb21339057a893b134a612
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Feb 9 01:16:12 2025 +0800
Remove MetaDataVersionPersistService.switchActiveVersion (#34616)
---
.../persist/version/MetaDataVersionPersistService.java | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/version/MetaDataVersionPersistService.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/version/MetaDataVersionPersistService.java
index ecb5b880ee0..5a1862cd176 100644
--- a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/version/MetaDataVersionPersistService.java
+++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/version/MetaDataVersionPersistService.java
@@ -24,7 +24,6 @@ import org.apache.shardingsphere.mode.node.path.metadata.DatabaseMetaDataNodePat
import org.apache.shardingsphere.mode.node.path.version.VersionNodePathGenerator;
import org.apache.shardingsphere.mode.spi.repository.PersistRepository;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@@ -52,23 +51,6 @@ public final class MetaDataVersionPersistService {
}
}
- /**
- * Switch active version.
- *
- * @param metaDataVersions meta data versions
- */
- public void switchActiveVersion(final Collection<MetaDataVersion> metaDataVersions) {
- for (MetaDataVersion each : metaDataVersions) {
- if (each.getNextActiveVersion().equals(each.getCurrentActiveVersion())) {
- continue;
- }
- VersionNodePathGenerator nodePathGenerator = new VersionNodePathGenerator(each.getPath());
- repository.persist(nodePathGenerator.getActiveVersionPath(), String.valueOf(each.getNextActiveVersion()));
- getVersions(nodePathGenerator.getVersionsPath()).stream()
- .filter(version -> version < each.getNextActiveVersion()).forEach(version -> repository.delete(nodePathGenerator.getVersionPath(version)));
- }
- }
-
/**
* Get next version.
*