Skip to content

Commit 8772eaa

Browse files
committed
Add DatabaseMetaDataPersistFacade.persistAlteredTables()
1 parent f4cefdf commit 8772eaa

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/metadata/DatabaseMetaDataPersistFacade.java

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public void unregisterStorageUnits(final String databaseName, final MetaDataCont
157157
* @param reloadMetaDataContexts reload meta data contexts
158158
* @param needReloadTables need reload tables
159159
* @return altered schema and tables map
160+
* @throws LoadTableMetaDataFailedException if an error occurs while loading table metadata
160161
*/
161162
public Map<String, Collection<ShardingSphereTable>> persistAlteredTables(final String databaseName, final MetaDataContexts reloadMetaDataContexts, final Collection<String> needReloadTables) {
162163
ShardingSphereDatabase database = reloadMetaDataContexts.getMetaData().getDatabase(databaseName);

mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistServiceTest.java

-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema;
2929
import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable;
3030
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
31-
import org.apache.shardingsphere.infra.rule.attribute.RuleAttributes;
32-
import org.apache.shardingsphere.infra.rule.attribute.table.TableMapperRuleAttribute;
3331
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
3432
import org.apache.shardingsphere.mode.metadata.changed.RuleItemChangedNodePathBuilder;
3533
import org.apache.shardingsphere.mode.metadata.manager.MetaDataContextManager;
@@ -171,7 +169,6 @@ void assertAlterRuleConfiguration() throws SQLException {
171169
when(database.getName()).thenReturn("foo_db");
172170
when(database.getProtocolType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "FIXTURE"));
173171
ShardingSphereRule rule = mock(ShardingSphereRule.class);
174-
when(rule.getAttributes()).thenReturn(new RuleAttributes(mock(TableMapperRuleAttribute.class)));
175172
when(database.getRuleMetaData().getRules()).thenReturn(Collections.singleton(rule));
176173
ShardingSphereMetaData metaData = new ShardingSphereMetaData(Collections.singleton(database), mock(), mock(), new ConfigurationProperties(new Properties()));
177174
when(metaDataContextManager.getMetaDataContexts().getMetaData()).thenReturn(metaData);
@@ -200,7 +197,6 @@ void assertRemoveRuleConfigurationItem() throws SQLException {
200197
when(database.getName()).thenReturn("foo_db");
201198
when(database.getProtocolType()).thenReturn(TypedSPILoader.getService(DatabaseType.class, "FIXTURE"));
202199
ShardingSphereRule rule = mock(ShardingSphereRule.class);
203-
when(rule.getAttributes()).thenReturn(new RuleAttributes(mock(TableMapperRuleAttribute.class)));
204200
when(database.getRuleMetaData().getRules()).thenReturn(Collections.singleton(rule));
205201
ShardingSphereMetaData metaData = new ShardingSphereMetaData(Collections.singleton(database), mock(), mock(), new ConfigurationProperties(new Properties()));
206202
when(metaDataContextManager.getMetaDataContexts().getMetaData()).thenReturn(metaData);

0 commit comments

Comments
 (0)