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 6fd7c3a7508 Remove DatabaseMetaDataNodePath.getTableRootPath() (#34560)
6fd7c3a7508 is described below
commit 6fd7c3a750804fdb375fab9edf4a080fef65f13d
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Feb 5 18:45:12 2025 +0800
Remove DatabaseMetaDataNodePath.getTableRootPath() (#34560)
* Remove DatabaseMetaDataNodePath.getTableRootPath()
* Remove DatabaseMetaDataNodePath.getTableRootPath()
---
.../metadata/service/SchemaMetaDataPersistService.java | 5 +++--
.../mode/node/path/metadata/DatabaseMetaDataNodePath.java | 13 -------------
.../mode/node/path/DatabaseMetaDataNodePathTest.java | 5 -----
3 files changed, 3 insertions(+), 20 deletions(-)
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/metadata/service/SchemaMetaDataPersistService.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/metadata/service/SchemaMetaDataPersistService.java
index b5c3a28aa0e..c71660d031c 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/metadata/service/SchemaMetaDataPersistService.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/metadata/service/SchemaMetaDataPersistService.java
@@ -19,8 +19,9 @@ package
org.apache.shardingsphere.mode.metadata.persist.metadata.service;
import
org.apache.shardingsphere.infra.metadata.database.schema.manager.GenericSchemaManager;
import
org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema;
-import
org.apache.shardingsphere.mode.node.path.metadata.DatabaseMetaDataNodePath;
import
org.apache.shardingsphere.mode.metadata.persist.version.MetaDataVersionPersistService;
+import
org.apache.shardingsphere.mode.node.path.metadata.DatabaseMetaDataNodePath;
+import org.apache.shardingsphere.mode.node.path.metadata.TableMetaDataNodePath;
import org.apache.shardingsphere.mode.spi.repository.PersistRepository;
import java.util.Collection;
@@ -51,7 +52,7 @@ public final class SchemaMetaDataPersistService {
* @param schemaName to be added schema name
*/
public void add(final String databaseName, final String schemaName) {
-
repository.persist(DatabaseMetaDataNodePath.getTableRootPath(databaseName,
schemaName), "");
+
repository.persist(TableMetaDataNodePath.getMetaDataTablesPath(databaseName,
schemaName), "");
}
/**
diff --git
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/metadata/DatabaseMetaDataNodePath.java
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/metadata/DatabaseMetaDataNodePath.java
index f2d5a0914f6..d2700824540 100644
---
a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/metadata/DatabaseMetaDataNodePath.java
+++
b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/metadata/DatabaseMetaDataNodePath.java
@@ -34,8 +34,6 @@ public final class DatabaseMetaDataNodePath {
private static final String SCHEMAS_NODE = "schemas";
- private static final String TABLES_NODE = "tables";
-
private static final String VERSIONS_NODE = "versions";
private static final String ACTIVE_VERSION_NODE = "active_version";
@@ -82,17 +80,6 @@ public final class DatabaseMetaDataNodePath {
return String.join("/", getSchemaRootPath(databaseName), schemaName);
}
- /**
- * Get table root path.
- *
- * @param databaseName database name
- * @param schemaName schema name
- * @return table root path
- */
- public static String getTableRootPath(final String databaseName, final
String schemaName) {
- return String.join("/", getSchemaPath(databaseName, schemaName),
TABLES_NODE);
- }
-
/**
* Get version path.
*
diff --git
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/DatabaseMetaDataNodePathTest.java
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/DatabaseMetaDataNodePathTest.java
index 6b94ff81233..1426b5779b1 100644
---
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/DatabaseMetaDataNodePathTest.java
+++
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/DatabaseMetaDataNodePathTest.java
@@ -50,11 +50,6 @@ class DatabaseMetaDataNodePathTest {
assertThat(DatabaseMetaDataNodePath.getSchemaPath("foo_db",
"foo_schema"), is("/metadata/foo_db/schemas/foo_schema"));
}
- @Test
- void assertGetTableRootPath() {
- assertThat(DatabaseMetaDataNodePath.getTableRootPath("foo_db",
"foo_schema"), is("/metadata/foo_db/schemas/foo_schema/tables"));
- }
-
@Test
void assertGetVersionPath() {
assertThat(DatabaseMetaDataNodePath.getVersionPath("foo_rule", "1"),
is("foo_rule/1"));