Skip to content

Commit

Permalink
Refactor ShowStorageUnitExecutor (#28689)
Browse files Browse the repository at this point in the history
* Refactor ShowStorageUnitExecutor

* Refactor ShowStorageUnitExecutor

* Refactor SQLFederationRuleConfiguration
  • Loading branch information
terrymanu authored Oct 8, 2023
1 parent 38405b2 commit 1e2fe35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
/**
* SQL federation rule configuration.
*/
@RequiredArgsConstructor
@Getter
@Setter
@RequiredArgsConstructor
public final class SQLFederationRuleConfiguration implements GlobalRuleConfiguration {

private final boolean sqlFederationEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public final class ShowSQLFederationRuleExecutor implements MetaDataRequiredQuer
@Override
public Collection<LocalDataQueryResultRow> getRows(final ShardingSphereMetaData metaData, final ShowSQLFederationRuleStatement sqlStatement) {
SQLFederationRuleConfiguration ruleConfig = metaData.getGlobalRuleMetaData().getSingleRule(SQLFederationRule.class).getConfiguration();
return Collections.singleton(new LocalDataQueryResultRow(String.valueOf(ruleConfig.isSqlFederationEnabled()),
null != ruleConfig.getExecutionPlanCache() ? ruleConfig.getExecutionPlanCache().toString() : ""));
String sqlFederationEnabled = String.valueOf(ruleConfig.isSqlFederationEnabled());
String executionPlanCache = null != ruleConfig.getExecutionPlanCache() ? ruleConfig.getExecutionPlanCache().toString() : "";
LocalDataQueryResultRow row = new LocalDataQueryResultRow(sqlFederationEnabled, executionPlanCache);
return Collections.singleton(row);
}

@Override
Expand Down

0 comments on commit 1e2fe35

Please sign in to comment.