You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2022/06/09 12:05:39 UTC

[shardingsphere] branch master updated: Rename variable name (#18270)

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

menghaoran 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 fcba4727d1a Rename variable name (#18270)
fcba4727d1a is described below

commit fcba4727d1ab11aa3f07b82945932a9116edc8a4
Author: zhaojinchao <zh...@apache.org>
AuthorDate: Thu Jun 9 20:05:27 2022 +0800

    Rename variable name (#18270)
    
    * Rename variable name
    
    * update it
---
 .../coordinator/ClusterContextManagerCoordinator.java        |  2 +-
 .../status/storage/event/StorageNodeChangedEvent.java        |  2 +-
 .../coordinator/ClusterContextManagerCoordinatorTest.java    |  2 +-
 .../storage/watcher/StorageNodeStateChangedWatcherTest.java  | 12 ++++++------
 .../ShowReadwriteSplittingReadResourcesHandler.java          |  6 +++---
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinator.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinator.java
index ad60f52ed13..6b01a695d02 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinator.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinator.java
@@ -181,7 +181,7 @@ public final class ClusterContextManagerCoordinator {
      */
     @Subscribe
     public synchronized void renew(final StorageNodeChangedEvent event) {
-        QualifiedDatabase qualifiedDatabase = event.getQualifiedSchema();
+        QualifiedDatabase qualifiedDatabase = event.getQualifiedDatabase();
         contextManager.getMetaDataContexts().getMetaData().getDatabases().get(qualifiedDatabase.getDatabaseName()).getRuleMetaData().getRules()
                 .stream().filter(each -> each instanceof StatusContainedRule)
                 .forEach(each -> ((StatusContainedRule) each).updateStatus(new StorageNodeDataSourceChangedEvent(qualifiedDatabase, event.getDataSource())));
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/event/StorageNodeChangedEvent.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/event/StorageNodeChangedEvent.java
index 2ec22cc3a70..f0ba9ba0bdb 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/event/StorageNodeChangedEvent.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/event/StorageNodeChangedEvent.java
@@ -30,7 +30,7 @@ import org.apache.shardingsphere.mode.metadata.storage.StorageNodeDataSource;
 @Getter
 public final class StorageNodeChangedEvent implements GovernanceEvent {
     
-    private final QualifiedDatabase qualifiedSchema;
+    private final QualifiedDatabase qualifiedDatabase;
     
     private final StorageNodeDataSource dataSource;
 }
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
index 57bff32c4c1..c6284f035a4 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
@@ -226,7 +226,7 @@ public final class ClusterContextManagerCoordinatorTest {
         StorageNodeChangedEvent event = new StorageNodeChangedEvent(new QualifiedDatabase("db.readwrite_ds.ds_0"), new StorageNodeDataSource(StorageNodeRole.MEMBER, StorageNodeStatus.DISABLED));
         coordinator.renew(event);
         verify(statusContainedRule, times(1)).updateStatus(argThat(
-                (ArgumentMatcher<StorageNodeDataSourceChangedEvent>) argumentEvent -> Objects.equals(event.getQualifiedSchema(), argumentEvent.getQualifiedDatabase())
+                (ArgumentMatcher<StorageNodeDataSourceChangedEvent>) argumentEvent -> Objects.equals(event.getQualifiedDatabase(), argumentEvent.getQualifiedDatabase())
                         && Objects.equals(event.getDataSource(), argumentEvent.getDataSource())));
     }
     
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/watcher/StorageNodeStateChangedWatcherTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/watcher/StorageNodeState [...]
index c1793bd0dd6..b130c952b3b 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/watcher/StorageNodeStateChangedWatcherTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/watcher/StorageNodeStateChangedWatcherTest.java
@@ -50,9 +50,9 @@ public final class StorageNodeStateChangedWatcherTest {
                 new DataChangedEvent("/nodes/storage_nodes/replica_query_db.readwrite_ds.replica_ds_0", "role: member\nstatus: enable\n", Type.ADDED));
         assertTrue(actual.isPresent());
         StorageNodeChangedEvent actualEvent = (StorageNodeChangedEvent) actual.get();
-        assertThat(actualEvent.getQualifiedSchema().getDatabaseName(), is("replica_query_db"));
-        assertThat(actualEvent.getQualifiedSchema().getGroupName(), is("readwrite_ds"));
-        assertThat(actualEvent.getQualifiedSchema().getDataSourceName(), is("replica_ds_0"));
+        assertThat(actualEvent.getQualifiedDatabase().getDatabaseName(), is("replica_query_db"));
+        assertThat(actualEvent.getQualifiedDatabase().getGroupName(), is("readwrite_ds"));
+        assertThat(actualEvent.getQualifiedDatabase().getDataSourceName(), is("replica_ds_0"));
         assertThat(actualEvent.getDataSource().getRole(), is("member"));
         assertThat(actualEvent.getDataSource().getStatus(), is("enable"));
     }
@@ -63,9 +63,9 @@ public final class StorageNodeStateChangedWatcherTest {
                 new DataChangedEvent("/nodes/storage_nodes/replica_query_db.readwrite_ds.replica_ds_0", "role: member\nstatus: disable\n", Type.DELETED));
         assertTrue(actual.isPresent());
         StorageNodeChangedEvent actualEvent = (StorageNodeChangedEvent) actual.get();
-        assertThat(actualEvent.getQualifiedSchema().getDatabaseName(), is("replica_query_db"));
-        assertThat(actualEvent.getQualifiedSchema().getGroupName(), is("readwrite_ds"));
-        assertThat(actualEvent.getQualifiedSchema().getDataSourceName(), is("replica_ds_0"));
+        assertThat(actualEvent.getQualifiedDatabase().getDatabaseName(), is("replica_query_db"));
+        assertThat(actualEvent.getQualifiedDatabase().getGroupName(), is("readwrite_ds"));
+        assertThat(actualEvent.getQualifiedDatabase().getDataSourceName(), is("replica_ds_0"));
         assertThat(actualEvent.getDataSource().getRole(), is("member"));
         assertThat(actualEvent.getDataSource().getStatus(), is("disable"));
     }
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowReadwriteSplittingReadResourcesHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowReadwriteSplittingReadResourcesHandler.java
index 6bea258a94a..efd4f271a6e 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowReadwriteSplittingReadResourcesHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowReadwriteSplittingReadResourcesHandler.java
@@ -111,9 +111,9 @@ public final class ShowReadwriteSplittingReadResourcesHandler extends QueryableR
         Map<String, StorageNodeDataSource> storageNodes = new StorageNodeStatusService((ClusterPersistRepository) persistService.getRepository()).loadStorageNodes();
         Map<String, StorageNodeDataSource> result = new HashMap<>();
         storageNodes.entrySet().stream().filter(entry -> "member".equalsIgnoreCase(entry.getValue().getRole())).forEach(entry -> {
-            QualifiedDatabase qualifiedSchema = new QualifiedDatabase(entry.getKey());
-            if (databaseName.equalsIgnoreCase(qualifiedSchema.getDatabaseName())) {
-                result.put(qualifiedSchema.getDataSourceName(), entry.getValue());
+            QualifiedDatabase qualifiedDatabase = new QualifiedDatabase(entry.getKey());
+            if (databaseName.equalsIgnoreCase(qualifiedDatabase.getDatabaseName())) {
+                result.put(qualifiedDatabase.getDataSourceName(), entry.getValue());
             }
         });
         return result;