Skip to content

Commit

Permalink
Refactor ShardingSphereDatabasesFactory's return value as collection
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Jan 19, 2025
1 parent 6eb4801 commit 1fe4130
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -78,7 +79,7 @@ public static Collection<ShardingSphereDatabase> create(final Map<String, Databa
final ConfigurationProperties props, final ComputeNodeInstanceContext instanceContext) throws SQLException {
DatabaseType protocolType = DatabaseTypeEngine.getProtocolType(databaseConfigMap, props);
SystemDatabase systemDatabase = new SystemDatabase(protocolType);
Collection<ShardingSphereDatabase> result = new HashSet<>(databaseConfigMap.size() + systemDatabase.getSystemDatabaseSchemaMap().size(), 1F);
Collection<ShardingSphereDatabase> result = new LinkedList<>();
result.addAll(createGenericDatabases(databaseConfigMap, protocolType, systemDatabase, props, instanceContext));
result.addAll(createSystemDatabases(databaseConfigMap, protocolType, systemDatabase, props));
return result;
Expand Down

0 comments on commit 1fe4130

Please sign in to comment.