Skip to content

Commit

Permalink
Refactor ShardingSphereStatisticsFactory (apache#34356)
Browse files Browse the repository at this point in the history
* Refactor MetaDataContexts

* Refactor ShardingSphereStatisticsFactory
  • Loading branch information
terrymanu authored Jan 14, 2025
1 parent 09dfa24 commit 47539a5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ private static DatabaseType getDatabaseType(final ShardingSphereMetaData metaDat
private static void useLoadedToReplaceInit(final ShardingSphereStatistics initStatistics, final ShardingSphereStatistics loadedStatistics) {
for (Entry<String, ShardingSphereDatabaseData> entry : initStatistics.getDatabaseData().entrySet()) {
if (loadedStatistics.getDatabaseData().containsKey(entry.getKey())) {
useLoadedToReplaceInitByDatabaseData(entry.getValue(), loadedStatistics.getDatabaseData().get(entry.getKey()));
useLoadedToReplaceInit(entry.getValue(), loadedStatistics.getDatabaseData().get(entry.getKey()));
}
}
}

private static void useLoadedToReplaceInitByDatabaseData(final ShardingSphereDatabaseData initDatabaseData, final ShardingSphereDatabaseData loadedDatabaseData) {
private static void useLoadedToReplaceInit(final ShardingSphereDatabaseData initDatabaseData, final ShardingSphereDatabaseData loadedDatabaseData) {
for (Entry<String, ShardingSphereSchemaData> entry : initDatabaseData.getSchemaData().entrySet()) {
if (loadedDatabaseData.getSchemaData().containsKey(entry.getKey())) {
useLoadedToReplaceInitBySchemaData(entry.getValue(), loadedDatabaseData.getSchemaData().get(entry.getKey()));
useLoadedToReplaceInit(entry.getValue(), loadedDatabaseData.getSchemaData().get(entry.getKey()));
}
}
}

private static void useLoadedToReplaceInitBySchemaData(final ShardingSphereSchemaData initSchemaData, final ShardingSphereSchemaData loadedSchemaData) {
private static void useLoadedToReplaceInit(final ShardingSphereSchemaData initSchemaData, final ShardingSphereSchemaData loadedSchemaData) {
for (Entry<String, ShardingSphereTableData> entry : initSchemaData.getTableData().entrySet()) {
if (loadedSchemaData.getTableData().containsKey(entry.getKey())) {
entry.setValue(loadedSchemaData.getTableData().get(entry.getKey()));
Expand Down

0 comments on commit 47539a5

Please sign in to comment.