diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngine.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngine.java index 6c99493bbd533..25c336abb95c1 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngine.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngine.java @@ -98,21 +98,6 @@ private static Map getDataSources(final DatabaseConfiguratio .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getDataSource(), (oldValue, currentValue) -> oldValue, LinkedHashMap::new)); } - /** - * Get storage types. - * - * @param databaseConfig database configuration - * @return storage types - */ - public static Map getStorageTypes(final DatabaseConfiguration databaseConfig) { - Map result = new LinkedHashMap<>(databaseConfig.getStorageUnits().size(), 1F); - Map dataSources = getDataSources(databaseConfig); - for (Entry entry : dataSources.entrySet()) { - result.put(entry.getKey(), getStorageType(entry.getValue())); - } - return result; - } - /** * Get storage type. * Similar to apache/hive#5554, diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java index bc49a70a10e97..0d822a345ee9a 100644 --- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java +++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/DatabaseTypeEngineTest.java @@ -42,7 +42,6 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -65,14 +64,6 @@ void assertGetProtocolTypeFromDataSource() throws SQLException { assertThat(DatabaseTypeEngine.getProtocolType(Collections.singletonMap("foo_db", databaseConfig), new ConfigurationProperties(new Properties())), instanceOf(PostgreSQLDatabaseType.class)); } - @Test - void assertGetStorageTypes() throws SQLException { - DataSource datasource = mockDataSource(TypedSPILoader.getService(DatabaseType.class, "MySQL")); - DatabaseConfiguration databaseConfig = new DataSourceProvidedDatabaseConfiguration(Collections.singletonMap("foo_db", datasource), Collections.singletonList(new FixtureRuleConfiguration())); - assertTrue(DatabaseTypeEngine.getStorageTypes(databaseConfig).containsKey("foo_db")); - assertThat(DatabaseTypeEngine.getStorageTypes(databaseConfig).get("foo_db"), instanceOf(MySQLDatabaseType.class)); - } - @Test void assertGetStorageType() throws SQLException { assertThat(DatabaseTypeEngine.getStorageType(mockDataSource(TypedSPILoader.getService(DatabaseType.class, "H2"))).getType(), is("H2"));