This is an automated email from the ASF dual-hosted git repository.
yx9o pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1e2fe35851f Refactor ShowStorageUnitExecutor (#28689)
1e2fe35851f is described below
commit 1e2fe35851f21809c34027e4fba2d5772a7fb006
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Oct 8 23:32:36 2023 +0800
Refactor ShowStorageUnitExecutor (#28689)
* Refactor ShowStorageUnitExecutor
* Refactor ShowStorageUnitExecutor
* Refactor SQLFederationRuleConfiguration
---
.../sqlfederation/api/config/SQLFederationRuleConfiguration.java | 2 +-
.../distsql/handler/query/ShowSQLFederationRuleExecutor.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git
a/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/api/config/SQLFederationRuleConfiguration.java
b/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/api/config/SQLFederationRuleConfiguration.java
index e1c09e0d13a..757f982f08c 100644
---
a/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/api/config/SQLFederationRuleConfiguration.java
+++
b/kernel/sql-federation/api/src/main/java/org/apache/shardingsphere/sqlfederation/api/config/SQLFederationRuleConfiguration.java
@@ -26,9 +26,9 @@ import org.apache.shardingsphere.sql.parser.api.CacheOption;
/**
* SQL federation rule configuration.
*/
+@RequiredArgsConstructor
@Getter
@Setter
-@RequiredArgsConstructor
public final class SQLFederationRuleConfiguration implements
GlobalRuleConfiguration {
private final boolean sqlFederationEnabled;
diff --git
a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
index 801d16d3468..f91ae15b29a 100644
---
a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
+++
b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
@@ -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