From 6cfb07a2469067640742dc64ba570c1d775f5099 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sat, 30 Sep 2023 01:14:55 +0800 Subject: [PATCH] Refactor ResourceMetaData --- .../infra/metadata/database/resource/ResourceMetaData.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java index 9be01787019b99..49ef85f8f46e94 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/ResourceMetaData.java @@ -25,7 +25,6 @@ import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNode; import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNodeName; import org.apache.shardingsphere.infra.metadata.database.resource.node.StorageNodeUtils; -import org.apache.shardingsphere.infra.metadata.database.resource.unit.NewStorageUnitMetaData; import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnitMetaData; import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnitNodeMapUtils; @@ -68,9 +67,9 @@ public ResourceMetaData(final String databaseName, final Map getAllInstanceDataSourceNames() { Collection result = new LinkedList<>(); - for (Entry entry : storageUnitMetaData.getMetaDataMap().entrySet()) { - if (!isExisted(entry.getKey(), result)) { - result.add(entry.getKey()); + for (String each : storageUnitMetaData.getMetaDataMap().keySet()) { + if (!isExisted(each, result)) { + result.add(each); } } return result;