zjcnb opened a new issue, #20477:
URL: https://github.com/apache/shardingsphere/issues/20477

   Hi community,
   
   I think the table metadata persistence and load has some problem. 
`ShardingSphere` is a distributed database, so we cannot go to the curd 
governance center based on the local table loading. So, we are plan to split 
three scenes.
   
   First scenes : After the local and governance center are compared, the 
persistent table is sent to the governance center.
   
   ```
   1. REFRESH TABLE METADATA : Refresh the table information of the logic 
database, ContextManager.reloadDatabase(final String databaseName)
   
   2. REFRESH TABLE METADATA : Refresh the table information of the schema, 
ContextManager.reloadSchema(final String databaseName, final String schemaName, 
final String dataSourceName)
   
   3. REFRESH TABLE METADATA : Refresh the table information of the table, 
ContextManager.reloadTable(final String databaseName, final String schemaName, 
final String dataSourceName, final String tableName) and 
ContextManager.reloadTable(final String databaseName, final String schemaName, 
final String tableName)
   
   ```
   
   Second scenes: Local direct persistence to the governance center.
   
   ```
   1. mode overwrite are true.
   
   2. Add resource by DistSQL : ContextManager.updateResources(final String 
databaseName, final Map<String, DataSourceProperties> 
toBeUpdatedDataSourcePropsMap)
   ```
   
   
   Third scenes: Load table metadata from governance center.
   
   1. mode overwrite are false.
   
   2. Alter resource by DistSQL : ContextManager.updateResources(final String 
databaseName, final Map<String, DataSourceProperties> 
toBeUpdatedDataSourcePropsMap)
   
   3. Alter rule configuration by DistSQL : 
ContextManager.alterRuleConfiguration(final String databaseName, final 
Collection<RuleConfiguration> ruleConfigs)
   
   4. Event monitoring Add or modify data source : 
ContextManager.alterDataSourceConfiguration(final String databaseName, final 
Map<String, DataSourceProperties> dataSourcePropsMap)
   
   5. Toggle new version of metadata : 
ContextManager.alterDataSourceAndRuleConfiguration(final String databaseName,
                                                                    final 
Map<String, DataSourceProperties> dataSourcePropsMap, final 
Collection<RuleConfiguration> ruleConfigs) 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to