Skip to content

Commit

Permalink
Remove DatabaseMetaDataNodePath.getTableRootPath()
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Feb 5, 2025
1 parent 9948a73 commit c810b34
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
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 @@ -82,17 +82,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 @@ -32,7 +32,7 @@ public final class TableMetaDataNodePath {

private static final String ROOT_NODE = "/metadata";

private static final String SCHEMAS_NODE = "schemas";
private static final String SCHEMAS_NODE = "schemas";e

private static final String TABLES_NODE = "tables";

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

0 comments on commit c810b34

Please sign in to comment.