Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DatabaseMetaDataNodePath.getTableRootPath() #34560

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

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;
Expand Down Expand Up @@ -51,7 +52,7 @@ public SchemaMetaDataPersistService(final PersistRepository repository, final Me
* @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), "");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -82,17 +80,6 @@ public static String getSchemaPath(final String databaseName, final String schem
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ void assertGetSchemaPath() {
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"));
Expand Down
Loading