This is an automated email from the ASF dual-hosted git repository.

sunnianjun 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 05668f1d844 Refactor ShowStatusFromReadwriteSplittingRulesStatement 
(#29837)
05668f1d844 is described below

commit 05668f1d844938b3382afcbd51c60d9ea46ab0fd
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Jan 24 20:55:49 2024 +0800

    Refactor ShowStatusFromReadwriteSplittingRulesStatement (#29837)
    
    * Refactor ShowStatusFromReadwriteSplittingRulesStatement
    
    * Add MetaDataAwareRQLExecutor
    
    * Add MetaDataAwareRQLExecutor
---
 README.md                                          |  1 +
 ...StatusFromReadwriteSplittingRulesStatement.java |  7 ++--
 .../storage/service/StorageNodeStatusService.java  |  6 ++--
 .../handler/distsql/rql/RQLBackendHandler.java     |  4 +++
 .../rql/aware/MetaDataAwareRQLExecutor.java        | 37 ++++++++++++++++++++++
 ...wStatusFromReadwriteSplittingRulesExecutor.java | 28 +++++++++-------
 ...sql.handler.type.ral.query.QueryableRALExecutor |  1 -
 ...dingsphere.distsql.handler.type.rql.RQLExecutor |  1 +
 ...tusFromReadwriteSplittingRulesExecutorTest.java |  6 ++--
 .../ral/impl/QueryableRALStatementAssert.java      |  3 --
 .../asserts/statement/rql/RQLStatementAssert.java  |  3 ++
 11 files changed, 72 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md
index 765155da229..b25b4452ac3 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@
 
[![Gitter](https://badges.gitter.im/shardingsphere/shardingsphere.svg)](https://gitter.im/shardingsphere/Lobby)
 
 
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/ShardingSphere.svg?style=social&label=Follow%20%40ShardingSphere)](https://twitter.com/ShardingSphere)
+
 |                                               **Stargazers Over Time**       
                                         | **Contributors Over Time**           
                                                                                
                                                                                
                                            |
 
|:---------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
 | [![Stargazers Over 
Time](https://starchart.cc/apache/shardingsphere.svg)](https://starchart.cc/apache/shardingsphere)
 | [![Contributor over 
time](https://contributor-graph-api.apiseven.com/contributors-svg?chart=contributorOverTime&repo=apache/shardingsphere)](https://www.apiseven.com/en/contributor-graph?chart=contributorOverTime&repo=apache/shardingsphere)
 |
diff --git 
a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
 
b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
index 5268b473553..4e99af727ff 100644
--- 
a/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
+++ 
b/features/readwrite-splitting/distsql/statement/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/statement/ShowStatusFromReadwriteSplittingRulesStatement.java
@@ -19,7 +19,7 @@ package 
org.apache.shardingsphere.readwritesplitting.distsql.statement;
 
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
-import 
org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
+import org.apache.shardingsphere.distsql.statement.rql.RQLStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
 import 
org.apache.shardingsphere.sql.parser.sql.common.statement.available.FromDatabaseAvailable;
 
@@ -28,10 +28,9 @@ import java.util.Optional;
 /**
  * Show status from readwrite-splitting rules statement.
  */
-
-@Getter
 @RequiredArgsConstructor
-public final class ShowStatusFromReadwriteSplittingRulesStatement extends 
QueryableRALStatement implements FromDatabaseAvailable {
+@Getter
+public final class ShowStatusFromReadwriteSplittingRulesStatement extends 
RQLStatement implements FromDatabaseAvailable {
     
     private final DatabaseSegment database;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/service/StorageNodeStatusService.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/service/StorageNodeStatusService.java
index a2f0710c295..83d82b597e5 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/service/StorageNodeStatusService.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/service/StorageNodeStatusService.java
@@ -20,11 +20,11 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.stat
 import com.google.common.base.Strings;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.mode.event.storage.StorageNodeDataSource;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.node.StorageNode;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.yaml.YamlStorageNodeDataSource;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.yaml.YamlStorageNodeDataSourceSwapper;
-import org.apache.shardingsphere.mode.event.storage.StorageNodeDataSource;
-import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.spi.PersistRepository;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -36,7 +36,7 @@ import java.util.Map;
 @RequiredArgsConstructor
 public final class StorageNodeStatusService {
     
-    private final ClusterPersistRepository repository;
+    private final PersistRepository repository;
     
     /**
      * Load storage node names.
diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/RQLBackendHandler.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/RQLBackendHandler.java
index 4718bad77f3..df6c2a3556c 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/RQLBackendHandler.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/RQLBackendHandler.java
@@ -31,6 +31,7 @@ import 
org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
 import 
org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLBackendHandler;
+import 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.aware.MetaDataAwareRQLExecutor;
 import org.apache.shardingsphere.proxy.backend.response.data.QueryResponseCell;
 import org.apache.shardingsphere.proxy.backend.response.data.QueryResponseRow;
 import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
@@ -73,6 +74,9 @@ public final class RQLBackendHandler implements 
DistSQLBackendHandler {
         if (executor instanceof GlobalRuleAwareRQLExecutor) {
             setUpGlobalRuleAwareExecutor((GlobalRuleAwareRQLExecutor) 
executor);
         }
+        if (executor instanceof MetaDataAwareRQLExecutor) {
+            ((MetaDataAwareRQLExecutor<?>) 
executor).setMetaDataContexts(ProxyContext.getInstance().getContextManager().getMetaDataContexts());
+        }
         mergedResult = null == mergedResult ? 
createMergedResult(executor.getRows(sqlStatement)) : mergedResult;
         return new QueryResponseHeader(queryHeaders);
     }
diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/aware/MetaDataAwareRQLExecutor.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/aware/MetaDataAwareRQLExecutor.java
new file mode 100644
index 00000000000..6062fdc635f
--- /dev/null
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/aware/MetaDataAwareRQLExecutor.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.proxy.backend.handler.distsql.rql.aware;
+
+import org.apache.shardingsphere.distsql.handler.type.rql.RQLExecutor;
+import org.apache.shardingsphere.distsql.statement.rql.RQLStatement;
+import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
+
+/**
+ * Meta data aware RQL executor.
+ * 
+ * @param <T> type of SQL statement
+ */
+public interface MetaDataAwareRQLExecutor<T extends RQLStatement> extends 
RQLExecutor<T> {
+    
+    /**
+     * Set database.
+     *
+     * @param metaDataContexts meta data contexts
+     */
+    void setMetaDataContexts(MetaDataContexts metaDataContexts);
+}
diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutor.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/type/ShowStatusFromReadwriteSplittingRulesExecutor.java
similarity index 88%
rename from 
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutor.java
rename to 
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/type/ShowStatusFromReadwriteSplittingRulesExecutor.java
index f17ff370ce2..caa3c6d4048 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutor.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/type/ShowStatusFromReadwriteSplittingRulesExecutor.java
@@ -15,13 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
+package org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type;
 
 import com.google.common.base.Strings;
 import lombok.Setter;
-import 
org.apache.shardingsphere.distsql.handler.type.ral.query.DatabaseAwareQueryableRALExecutor;
+import 
org.apache.shardingsphere.distsql.handler.type.rql.aware.DatabaseAwareRQLExecutor;
 import 
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
 import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDatabase;
 import 
org.apache.shardingsphere.infra.rule.identifier.type.exportable.ExportableRule;
@@ -33,8 +32,9 @@ import 
org.apache.shardingsphere.metadata.persist.MetaDataBasedPersistService;
 import org.apache.shardingsphere.mode.event.storage.StorageNodeDataSource;
 import org.apache.shardingsphere.mode.event.storage.StorageNodeRole;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.storage.service.StorageNodeStatusService;
+import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
 import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
-import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
+import 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.aware.MetaDataAwareRQLExecutor;
 import 
org.apache.shardingsphere.readwritesplitting.distsql.statement.ShowStatusFromReadwriteSplittingRulesStatement;
 
 import java.util.Arrays;
@@ -53,9 +53,14 @@ import java.util.stream.Collectors;
  * Show status from readwrite-splitting rules executor.
  */
 @Setter
-public final class ShowStatusFromReadwriteSplittingRulesExecutor implements 
DatabaseAwareQueryableRALExecutor<ShowStatusFromReadwriteSplittingRulesStatement>
 {
+public final class ShowStatusFromReadwriteSplittingRulesExecutor
+        implements
+            
DatabaseAwareRQLExecutor<ShowStatusFromReadwriteSplittingRulesStatement>,
+            
MetaDataAwareRQLExecutor<ShowStatusFromReadwriteSplittingRulesStatement> {
     
-    private ShardingSphereDatabase currentDatabase;
+    private ShardingSphereDatabase database;
+    
+    private MetaDataContexts metaDataContexts;
     
     @Override
     public Collection<String> getColumnNames() {
@@ -63,14 +68,13 @@ public final class 
ShowStatusFromReadwriteSplittingRulesExecutor implements Data
     }
     
     @Override
-    public Collection<LocalDataQueryResultRow> getRows(final 
ShowStatusFromReadwriteSplittingRulesStatement sqlStatement, final 
ShardingSphereMetaData metaData) {
-        Collection<String> allReadResources = 
getAllReadResources(currentDatabase, sqlStatement.getGroupName());
-        Map<String, StorageNodeDataSource> persistentReadResources = 
getPersistentReadResources(
-                currentDatabase.getName(), 
ProxyContext.getInstance().getContextManager().getMetaDataContexts().getPersistService());
+    public Collection<LocalDataQueryResultRow> getRows(final 
ShowStatusFromReadwriteSplittingRulesStatement sqlStatement) {
+        Collection<String> allReadResources = 
getAllReadResources(sqlStatement.getGroupName());
+        Map<String, StorageNodeDataSource> persistentReadResources = 
getPersistentReadResources(database.getName(), 
metaDataContexts.getPersistService());
         return buildRows(allReadResources, persistentReadResources);
     }
     
-    private Collection<String> getAllReadResources(final 
ShardingSphereDatabase database, final String groupName) {
+    private Collection<String> getAllReadResources(final String groupName) {
         Collection<String> exportKeys = 
Arrays.asList(ExportableConstants.EXPORT_STATIC_READWRITE_SPLITTING_RULE, 
ExportableConstants.EXPORT_DYNAMIC_READWRITE_SPLITTING_RULE);
         Map<String, Object> exportMap = 
database.getRuleMetaData().findRules(ExportableRule.class).stream()
                 .filter(each -> new 
RuleExportEngine(each).containExportableKey(exportKeys)).findFirst().map(each 
-> new 
RuleExportEngine(each).export(exportKeys)).orElse(Collections.emptyMap());
@@ -88,7 +92,7 @@ public final class 
ShowStatusFromReadwriteSplittingRulesExecutor implements Data
         if (null == persistService || null == persistService.getRepository() 
|| !(persistService.getRepository() instanceof ClusterPersistRepository)) {
             return Collections.emptyMap();
         }
-        Map<String, StorageNodeDataSource> storageNodes = new 
StorageNodeStatusService((ClusterPersistRepository) 
persistService.getRepository()).loadStorageNodes();
+        Map<String, StorageNodeDataSource> storageNodes = new 
StorageNodeStatusService(persistService.getRepository()).loadStorageNodes();
         Map<String, StorageNodeDataSource> result = new HashMap<>();
         storageNodes.entrySet().stream().filter(entry -> 
StorageNodeRole.MEMBER == entry.getValue().getRole()).forEach(entry -> {
             QualifiedDatabase qualifiedDatabase = new 
QualifiedDatabase(entry.getKey());
diff --git 
a/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor
 
b/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor
index 0a2c431c9b0..986d3b55d49 100644
--- 
a/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor
+++ 
b/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.ral.query.QueryableRALExecutor
@@ -24,7 +24,6 @@ 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ExportStor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ConvertYamlConfigurationExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowDistVariableExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowDistVariablesExecutor
-org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowStatusFromReadwriteSplittingRulesExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowTableMetaDataExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowMigrationRuleExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowServiceProviderImplementationsExecutor
diff --git 
a/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.rql.RQLExecutor
 
b/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.rql.RQLExecutor
index 1165829c10b..9b3f94a5f9c 100644
--- 
a/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.rql.RQLExecutor
+++ 
b/proxy/backend/core/src/main/resources/META-INF/services/org.apache.shardingsphere.distsql.handler.type.rql.RQLExecutor
@@ -18,3 +18,4 @@
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type.ShowStorageUnitExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type.ShowRulesUsedStorageUnitExecutor
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type.ShowLogicalTableExecutor
+org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type.ShowStatusFromReadwriteSplittingRulesExecutor
diff --git 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutorTest.java
 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutorTest.java
index e057930d96f..3e42156be64 100644
--- 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutorTest.java
+++ 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowStatusFromReadwriteSplittingRulesExecutorTest.java
@@ -32,6 +32,7 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
 import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
 import 
org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository;
 import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
+import 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.type.ShowStatusFromReadwriteSplittingRulesExecutor;
 import 
org.apache.shardingsphere.readwritesplitting.distsql.statement.ShowStatusFromReadwriteSplittingRulesStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
 import 
org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
@@ -73,9 +74,10 @@ class ShowStatusFromReadwriteSplittingRulesExecutorTest {
         ShowStatusFromReadwriteSplittingRulesExecutor executor = new 
ShowStatusFromReadwriteSplittingRulesExecutor();
         ContextManager contextManager = mockContextManager();
         
when(ProxyContext.getInstance().getContextManager()).thenReturn(contextManager);
-        
executor.setCurrentDatabase(mockMetaData().getDatabase("readwrite_db"));
+        
executor.setDatabase(contextManager.getMetaDataContexts().getMetaData().getDatabase("readwrite_db"));
+        executor.setMetaDataContexts(contextManager.getMetaDataContexts());
         Collection<LocalDataQueryResultRow> actual = executor.getRows(
-                new ShowStatusFromReadwriteSplittingRulesStatement(new 
DatabaseSegment(1, 1, new IdentifierValue("readwrite_db")), null), 
mockMetaData());
+                new ShowStatusFromReadwriteSplittingRulesStatement(new 
DatabaseSegment(1, 1, new IdentifierValue("readwrite_db")), null));
         assertTrue(actual.isEmpty());
     }
     
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ral/impl/QueryableRALStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ral/impl/QueryableRALStatementAssert.java
index 25803ba69a7..60620724737 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ral/impl/QueryableRALStatementAssert.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ral/impl/QueryableRALStatementAssert.java
@@ -30,7 +30,6 @@ import 
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowComput
 import 
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowDistVariableStatement;
 import 
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowDistVariablesStatement;
 import 
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowTableMetaDataStatement;
-import 
org.apache.shardingsphere.readwritesplitting.distsql.statement.ShowStatusFromReadwriteSplittingRulesStatement;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ExistingAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ral.impl.queryable.ConvertYamlConfigurationStatementAssert;
@@ -63,8 +62,6 @@ public final class QueryableRALStatementAssert {
             ShowDistVariablesStatementAssert.assertIs(assertContext, 
(ShowDistVariablesStatement) actual, (ShowDistVariablesStatementTestCase) 
expected);
         } else if (actual instanceof ShowComputeNodesStatement) {
             ExistingAssert.assertIs(assertContext, actual, expected);
-        } else if (actual instanceof 
ShowStatusFromReadwriteSplittingRulesStatement) {
-            ExistingAssert.assertIs(assertContext, actual, expected);
         } else if (actual instanceof ShowTableMetaDataStatement) {
             ShowTableMetaDataStatementAssert.assertIs(assertContext, 
(ShowTableMetaDataStatement) actual, (ShowTableMetaDataStatementTestCase) 
expected);
         } else if (actual instanceof ExportDatabaseConfigurationStatement) {
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rql/RQLStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rql/RQLStatementAssert.java
index 4ae2a6bc5d9..958a3f8c697 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rql/RQLStatementAssert.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rql/RQLStatementAssert.java
@@ -25,6 +25,7 @@ import 
org.apache.shardingsphere.distsql.statement.rql.show.ShowRulesStatement;
 import 
org.apache.shardingsphere.distsql.statement.rql.show.ShowStorageUnitsStatement;
 import 
org.apache.shardingsphere.distsql.statement.rql.show.ShowTablesStatement;
 import 
org.apache.shardingsphere.parser.distsql.statement.queryable.ShowSQLParserRuleStatement;
+import 
org.apache.shardingsphere.readwritesplitting.distsql.statement.ShowStatusFromReadwriteSplittingRulesStatement;
 import 
org.apache.shardingsphere.sqltranslator.distsql.statement.queryable.ShowSQLTranslatorRuleStatement;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ExistingAssert;
@@ -67,6 +68,8 @@ public final class RQLStatementAssert {
             ExistingAssert.assertIs(assertContext, actual, expected);
         } else if (actual instanceof ShowSQLTranslatorRuleStatement) {
             ExistingAssert.assertIs(assertContext, actual, expected);
+        } else if (actual instanceof 
ShowStatusFromReadwriteSplittingRulesStatement) {
+            ExistingAssert.assertIs(assertContext, actual, expected);
         }
     }
 }

Reply via email to