Skip to content

Commit

Permalink
Use enum to replace string keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
RaigorJiang committed Nov 7, 2023
1 parent e2b293e commit 856ade7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public Collection<String> getColumnNames() {

@Override
public Collection<LocalDataQueryResultRow> getRows(final ShardingSphereMetaData metaData, final ConnectionSession connectionSession, final ShowDistVariablesStatement sqlStatement) {
Collection<LocalDataQueryResultRow> result = ConfigurationPropertyKey.getKeyNames().stream().filter(each -> !"sql_show".equalsIgnoreCase(each) && !"sql_simple".equalsIgnoreCase(each))
Collection<LocalDataQueryResultRow> result = ConfigurationPropertyKey.getKeyNames().stream()
.filter(each -> !ConfigurationPropertyKey.SQL_SHOW.name().equalsIgnoreCase(each) && !ConfigurationPropertyKey.SQL_SIMPLE.name().equalsIgnoreCase(each))
.map(each -> new LocalDataQueryResultRow(each.toLowerCase(), getStringResult(metaData.getProps().getValue(ConfigurationPropertyKey.valueOf(each))))).collect(Collectors.toList());
result.addAll(TemporaryConfigurationPropertyKey.getKeyNames().stream()
.map(each -> new LocalDataQueryResultRow(each.toLowerCase(), getStringResult(metaData.getTemporaryProps().getValue(TemporaryConfigurationPropertyKey.valueOf(each)))))
Expand Down

0 comments on commit 856ade7

Please sign in to comment.