This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 c51349c Revise root node from states to status (#12321)
c51349c is described below
commit c51349c828de04b6db5bca2a2c6908c9d7a69c4a
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Sep 9 22:01:33 2021 +0800
Revise root node from states to status (#12321)
---
.../coordinator/ClusterContextManagerCoordinator.java | 4 ++--
.../manager/cluster/coordinator/RegistryCenter.java | 6 +++---
.../coordinator/lock/service/LockRegistryService.java | 4 ++--
.../authority/watcher/PrivilegeNodeChangedWatcher.java | 4 ++--
.../subscriber/GlobalRuleRegistrySubscriber.java | 2 +-
.../registry/{state => status}/ResourceState.java | 2 +-
.../event/DisabledStateChangedEvent.java | 2 +-
.../event/PrimaryStateChangedEvent.java | 2 +-
.../StatesNode.java => status/node/StatusNode.java} | 8 ++++----
.../service/DataSourceStatusRegistryService.java | 10 +++++-----
.../service/InstanceStatusRegistryService.java | 10 +++++-----
.../service/UserStatusRegistryService.java | 6 +++---
.../subscriber/DataSourceStatusRegistrySubscriber.java | 10 +++++-----
.../watcher/DataSourceStateChangedWatcher.java | 18 +++++++++---------
.../watcher/TerminalStateChangedWatcher.java | 8 ++++----
...ager.cluster.coordinator.registry.GovernanceWatcher | 4 ++--
.../ClusterContextManagerCoordinatorTest.java | 2 +-
.../node/StatusNodeTest.java} | 16 ++++++++--------
.../service/DataSourceStatusRegistryServiceTest.java | 2 +-
.../service/InstanceStatusRegistryServiceTest.java | 6 +++---
.../DataSourceStatusRegistrySubscriberTest.java | 10 +++++-----
.../watcher/DataSourceStateChangedWatcherTest.java | 6 +++---
.../watcher/TerminalStateChangedWatcherTest.java | 4 ++--
23 files changed, 73 insertions(+), 73 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 ed85279..0d1eace 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
@@ -50,8 +50,8 @@ import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.confi
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.config.event.schema.SchemaChangedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.event.SchemaAddedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.event.SchemaDeletedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.DisabledStateChangedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.PrimaryStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.DisabledStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.PrimaryStateChangedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.schema.ClusterSchema;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.MetaDataContextsBuilder;
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/RegistryCenter.java
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/RegistryCenter.java
index 05c371b..5526881 100644
---
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/RegistryCenter.java
+++
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/RegistryCenter.java
@@ -24,9 +24,9 @@ import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.cache
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.config.subscriber.GlobalRuleRegistrySubscriber;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.subscriber.SchemaMetaDataRegistrySubscriber;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ProcessRegistrySubscriber;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service.DataSourceStatusRegistryService;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service.InstanceStatusRegistryService;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.subscriber.DataSourceStatusRegistrySubscriber;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service.DataSourceStatusRegistryService;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service.InstanceStatusRegistryService;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.subscriber.DataSourceStatusRegistrySubscriber;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
/**
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/lock/service/LockRegistryService.java
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/service/LockRegistryService.java
index d1da69d..9b89e61 100644
---
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/service/LockRegistryService.java
+++
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/service/LockRegistryService.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.mode.manager.cluster.coordinator.lock.service;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.ClusterInstance;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import java.util.Collection;
@@ -111,7 +111,7 @@ public final class LockRegistryService {
}
private boolean checkAck(final String lockName, final String ackValue,
final long timeoutMilliseconds) {
- Collection<String> instanceIds =
repository.getChildrenKeys(StatesNode.getProxyNodesPath());
+ Collection<String> instanceIds =
repository.getChildrenKeys(StatusNode.getProxyNodesPath());
long checkMilliseconds = timeoutMilliseconds;
while (checkMilliseconds > 0) {
long start = System.currentTimeMillis();
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/authority/watcher/PrivilegeNodeChangedWatcher.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/authority/watcher/PrivilegeNodeChangedWatcher.java
index 2fd2966..b63e113 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/authority/watcher/PrivilegeNodeChangedWatcher.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/authority/watcher/PrivilegeNodeChangedWatcher.java
@@ -18,7 +18,7 @@
package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.authority.watcher;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.authority.event.AuthorityChangedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent.Type;
@@ -36,7 +36,7 @@ public final class PrivilegeNodeChangedWatcher implements
GovernanceWatcher<Auth
@Override
public Collection<String> getWatchingKeys() {
- return Collections.singletonList(StatesNode.getPrivilegeNodePath());
+ return Collections.singletonList(StatusNode.getPrivilegeNodePath());
}
@Override
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/config/subscriber/GlobalRuleRegistrySubscriber.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/config/subscriber/GlobalRuleRegistrySubscriber.java
index 2fdfb4c..dc9c7a0 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/config/subscriber/GlobalRuleRegistrySubscriber.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/config/subscriber/GlobalRuleRegistrySubscriber.java
@@ -22,7 +22,7 @@ import com.google.common.eventbus.Subscribe;
import org.apache.shardingsphere.authority.config.AuthorityRuleConfiguration;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import
org.apache.shardingsphere.mode.persist.service.impl.GlobalRulePersistService;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service.UserStatusRegistryService;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service.UserStatusRegistryService;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
import
org.apache.shardingsphere.infra.metadata.mapper.event.dcl.impl.CreateUserStatementEvent;
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/state/ResourceState.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/ResourceState.java
similarity index 98%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/ResourceState.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/ResourceState.java
index 5cd88bc..9d43765 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/state/ResourceState.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/ResourceState.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status;
/**
* Resource state.
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/state/event/DisabledStateChangedEvent.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/event/DisabledStateChangedEvent.java
similarity index 98%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/event/DisabledStateChangedEvent.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/event/DisabledStateChangedEvent.java
index 143ecb0..b4f5ab3 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/state/event/DisabledStateChangedEvent.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/event/DisabledStateChangedEvent.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
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/state/event/PrimaryStateChangedEvent.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/event/PrimaryStateChangedEvent.java
similarity index 98%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/event/PrimaryStateChangedEvent.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/event/PrimaryStateChangedEvent.java
index 1d249e8..5a196ea 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/state/event/PrimaryStateChangedEvent.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/event/PrimaryStateChangedEvent.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
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/state/node/StatesNode.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/node/StatusNode.java
similarity index 97%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/node/StatesNode.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/node/StatusNode.java
index a21f09e..b485edb 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/state/node/StatesNode.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/node/StatusNode.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node;
import com.google.common.base.Joiner;
import lombok.AccessLevel;
@@ -27,12 +27,12 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
- * States node.
+ * Status node.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class StatesNode {
+public final class StatusNode {
- private static final String ROOT_NODE = "states";
+ private static final String ROOT_NODE = "status";
private static final String PROXY_NODE = "proxynodes";
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/state/service/DataSourceStatusRegistryService.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/service/DataSourceStatusRegistryService.java
similarity index 90%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/service/DataSourceStatusRegistryService.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/service/DataSourceStatusRegistryService.java
index a55faf0..062b8e0 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/state/service/DataSourceStatusRegistryService.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/service/DataSourceStatusRegistryService.java
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service;
import com.google.common.base.Strings;
import lombok.RequiredArgsConstructor;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import java.util.Collection;
@@ -46,10 +46,10 @@ public final class DataSourceStatusRegistryService {
}
private Collection<String> loadDataSources(final String schemaName) {
- return
repository.getChildrenKeys(StatesNode.getSchemaPath(schemaName));
+ return
repository.getChildrenKeys(StatusNode.getSchemaPath(schemaName));
}
private String getDataSourceNodeData(final String schemaName, final String
dataSourceName) {
- return repository.get(StatesNode.getDataSourcePath(schemaName,
dataSourceName));
+ return repository.get(StatusNode.getDataSourcePath(schemaName,
dataSourceName));
}
}
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/state/service/InstanceStatusRegistryService.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/service/InstanceStatusRegistryService.java
similarity index 84%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/service/InstanceStatusRegistryService.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/service/InstanceStatusRegistryService.java
index 8120251..542b659 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/state/service/InstanceStatusRegistryService.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/service/InstanceStatusRegistryService.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service;
import lombok.RequiredArgsConstructor;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
/**
@@ -35,8 +35,8 @@ public final class InstanceStatusRegistryService {
* @param instanceId instance ID
*/
public void registerInstanceOnline(final String instanceId) {
- repository.persist(StatesNode.getDataNodesPath(), "");
- repository.persist(StatesNode.getPrimaryNodesPath(), "");
- repository.persistEphemeral(StatesNode.getProxyNodePath(instanceId),
"");
+ repository.persist(StatusNode.getDataNodesPath(), "");
+ repository.persist(StatusNode.getPrimaryNodesPath(), "");
+ repository.persistEphemeral(StatusNode.getProxyNodePath(instanceId),
"");
}
}
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/state/service/UserStatusRegistryService.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/service/UserStatusRegistryService.java
similarity index 93%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/service/UserStatusRegistryService.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/service/UserStatusRegistryService.java
index 6521c02..467507e 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/state/service/UserStatusRegistryService.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/service/UserStatusRegistryService.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service;
import lombok.RequiredArgsConstructor;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
import
org.apache.shardingsphere.infra.metadata.user.yaml.config.YamlUsersConfigurationConverter;
@@ -40,6 +40,6 @@ public final class UserStatusRegistryService {
* @param users users
*/
public void persist(final Collection<ShardingSphereUser> users) {
- repository.persist(StatesNode.getPrivilegeNodePath(),
YamlEngine.marshal(YamlUsersConfigurationConverter.convertYamlUserConfigurations(users)));
+ repository.persist(StatusNode.getPrivilegeNodePath(),
YamlEngine.marshal(YamlUsersConfigurationConverter.convertYamlUserConfigurations(users)));
}
}
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/state/subscriber/DataSourceStatusRegistrySubscriber.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/subscriber/DataSourceStatusRegistrySub
[...]
similarity index 91%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/subscriber/DataSourceStatusRegistrySubscriber.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/subscriber/DataSourceStatusRegistrySubscriber.java
index 928f40d..87dedba 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/state/subscriber/DataSourceStatusRegistrySubscriber.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/subscriber/DataSourceStatusRegistrySubscriber.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.subscriber;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.subscriber;
import com.google.common.eventbus.Subscribe;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.apache.shardingsphere.infra.eventbus.ShardingSphereEventBus;
import org.apache.shardingsphere.infra.rule.event.impl.DataSourceDisabledEvent;
@@ -45,7 +45,7 @@ public final class DataSourceStatusRegistrySubscriber {
@Subscribe
public void update(final DataSourceDisabledEvent event) {
String value = event.isDisabled() ? ResourceState.DISABLED.toString()
: "";
- repository.persist(StatesNode.getDataSourcePath(event.getSchemaName(),
event.getDataSourceName()), value);
+ repository.persist(StatusNode.getDataSourcePath(event.getSchemaName(),
event.getDataSourceName()), value);
}
/**
@@ -55,6 +55,6 @@ public final class DataSourceStatusRegistrySubscriber {
*/
@Subscribe
public void update(final PrimaryDataSourceChangedEvent event) {
-
repository.persist(StatesNode.getPrimaryDataSourcePath(event.getSchemaName(),
event.getGroupName()), event.getDataSourceName());
+
repository.persist(StatusNode.getPrimaryDataSourcePath(event.getSchemaName(),
event.getGroupName()), event.getDataSourceName());
}
}
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/state/watcher/DataSourceStateChangedWatcher.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/watcher/DataSourceStateChangedWatcher.java
similarity index 83%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/watcher/DataSourceStateChangedWatcher.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/watcher/DataSourceStateChangedWatcher.java
index 43eb4dd..bbc96eb 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/state/watcher/DataSourceStateChangedWatcher.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/watcher/DataSourceStateChangedWatcher.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.DisabledStateChangedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.PrimaryStateChangedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.DisabledStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.PrimaryStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent.Type;
@@ -37,7 +37,7 @@ public final class DataSourceStateChangedWatcher implements
GovernanceWatcher<Go
@Override
public Collection<String> getWatchingKeys() {
- return Arrays.asList(StatesNode.getPrimaryNodesPath(),
StatesNode.getDataNodesPath());
+ return Arrays.asList(StatusNode.getPrimaryNodesPath(),
StatusNode.getDataNodesPath());
}
@Override
@@ -47,10 +47,10 @@ public final class DataSourceStateChangedWatcher implements
GovernanceWatcher<Go
@Override
public Optional<GovernanceEvent> createGovernanceEvent(final
DataChangedEvent event) {
- if (StatesNode.isPrimaryDataSourcePath(event.getKey())) {
- return
StatesNode.getPrimaryNodesClusterSchema(event.getKey()).map(schema -> new
PrimaryStateChangedEvent(schema, event.getValue()));
+ if (StatusNode.isPrimaryDataSourcePath(event.getKey())) {
+ return
StatusNode.getPrimaryNodesClusterSchema(event.getKey()).map(schema -> new
PrimaryStateChangedEvent(schema, event.getValue()));
}
- return StatesNode.getClusterSchema(event.getKey()).map(schema -> new
DisabledStateChangedEvent(schema, isDataSourceDisabled(event)));
+ return StatusNode.getClusterSchema(event.getKey()).map(schema -> new
DisabledStateChangedEvent(schema, isDataSourceDisabled(event)));
}
private boolean isDataSourceDisabled(final DataChangedEvent event) {
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/state/watcher/TerminalStateChangedWatcher.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/watcher/TerminalStateChangedWatcher.java
similarity index 92%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/watcher/TerminalStateChangedWatcher.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/watcher/TerminalStateChangedWatcher.java
index c66a8ee..1ae0efc 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/state/watcher/TerminalStateChangedWatcher.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/watcher/TerminalStateChangedWatcher.java
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher;
import org.apache.shardingsphere.infra.state.StateEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent.Type;
@@ -35,7 +35,7 @@ public final class TerminalStateChangedWatcher implements
GovernanceWatcher<Stat
@Override
public Collection<String> getWatchingKeys() {
- return Collections.singleton(StatesNode.getProxyNodesPath());
+ return Collections.singleton(StatusNode.getProxyNodesPath());
}
@Override
diff --git
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher
index 61f72e2..9fe984a 100644
---
a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher
+++
b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcher
@@ -15,10 +15,10 @@
# limitations under the License.
#
-org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher.DataSourceStateChangedWatcher
+org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher.DataSourceStateChangedWatcher
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.watcher.MetaDataChangedWatcher
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.config.watcher.GlobalRuleChangedWatcher
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.authority.watcher.PrivilegeNodeChangedWatcher
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.config.watcher.PropertiesChangedWatcher
-org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher.TerminalStateChangedWatcher
+org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher.TerminalStateChangedWatcher
org.apache.shardingsphere.mode.manager.cluster.coordinator.lock.watcher.LockChangedWatcher
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 24a9618..aec5097 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
@@ -50,7 +50,7 @@ import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.confi
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.config.event.schema.SchemaChangedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.event.SchemaAddedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.metadata.event.SchemaDeletedEvent;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.DisabledStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.DisabledStateChangedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.schema.ClusterSchema;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.persist.PersistService;
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/state/node/StatesNodeTest.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/node/StatusNodeTest.java
similarity index 75%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/node/StatesNodeTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/node/StatusNodeTest.java
index 94d37b8..d27392a 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/state/node/StatesNodeTest.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/node/StatusNodeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.schema.ClusterSchema;
import org.junit.Test;
@@ -26,21 +26,21 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-public final class StatesNodeTest {
+public final class StatusNodeTest {
@Test
public void assertGetProxyNodePath() {
- assertThat(StatesNode.getProxyNodePath("testId"),
is("/states/proxynodes/testId"));
+ assertThat(StatusNode.getProxyNodePath("testId"),
is("/status/proxynodes/testId"));
}
@Test
public void assertGetDataNodesPath() {
- assertThat(StatesNode.getDataNodesPath(), is("/states/datanodes"));
+ assertThat(StatusNode.getDataNodesPath(), is("/status/datanodes"));
}
@Test
public void assertGetClusterSchema() {
- Optional<ClusterSchema> actual =
StatesNode.getClusterSchema("/states/datanodes/replica_query_db/replica_ds_0");
+ Optional<ClusterSchema> actual =
StatusNode.getClusterSchema("/status/datanodes/replica_query_db/replica_ds_0");
assertTrue(actual.isPresent());
assertThat(actual.get().getSchemaName(), is("replica_query_db"));
assertThat(actual.get().getDataSourceName(), is("replica_ds_0"));
@@ -48,7 +48,7 @@ public final class StatesNodeTest {
@Test
public void assertGetClusterSchemaForIpDataSourceName() {
- Optional<ClusterSchema> actual =
StatesNode.getClusterSchema("/states/datanodes/replica_query_db/127.0.0.1");
+ Optional<ClusterSchema> actual =
StatusNode.getClusterSchema("/status/datanodes/replica_query_db/127.0.0.1");
assertTrue(actual.isPresent());
assertThat(actual.get().getSchemaName(), is("replica_query_db"));
assertThat(actual.get().getDataSourceName(), is("127.0.0.1"));
@@ -56,11 +56,11 @@ public final class StatesNodeTest {
@Test
public void assertGetDataSourcePath() {
- assertThat(StatesNode.getDataSourcePath("replica_query_db",
"replica_ds_0"), is("/states/datanodes/replica_query_db/replica_ds_0"));
+ assertThat(StatusNode.getDataSourcePath("replica_query_db",
"replica_ds_0"), is("/status/datanodes/replica_query_db/replica_ds_0"));
}
@Test
public void assertGetPrivilegeNodePath() {
- assertThat(StatesNode.getPrivilegeNodePath(),
is("/states/privilegenode"));
+ assertThat(StatusNode.getPrivilegeNodePath(),
is("/status/privilegenode"));
}
}
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/state/service/DataSourceStatusRegistryServiceTest.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/service/DataSourceStatusRegistryServiceT
[...]
similarity index 98%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/service/DataSourceStatusRegistryServiceTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/service/DataSourceStatusRegistryServiceTest.java
index 71b27ec..324bdb9 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/state/service/DataSourceStatusRegistryServiceTest.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/service/DataSourceStatusRegistryServiceTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.junit.Test;
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/state/service/InstanceStatusRegistryServiceTest.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/service/InstanceStatusRegistryServiceTest.java
similarity index 91%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/service/InstanceStatusRegistryServiceTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/service/InstanceStatusRegistryServiceTest.java
index f4a0a83..fc4ca01 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/state/service/InstanceStatusRegistryServiceTest.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/service/InstanceStatusRegistryServiceTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.service;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.service;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.junit.Test;
@@ -35,8 +35,8 @@ public final class InstanceStatusRegistryServiceTest {
@Test
public void assertRegisterInstanceOnline() {
new
InstanceStatusRegistryService(repository).registerInstanceOnline("foo");
- verify(repository).persist("/states/datanodes", "");
- verify(repository).persist("/states/primarynodes", "");
+ verify(repository).persist("/status/datanodes", "");
+ verify(repository).persist("/status/primarynodes", "");
verify(repository).persistEphemeral(anyString(), anyString());
}
}
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/state/subscriber/DataSourceStatusRegistrySubscriberTest.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/subscriber/DataSourceStatusRegistr
[...]
similarity index 92%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/subscriber/DataSourceStatusRegistrySubscriberTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/subscriber/DataSourceStatusRegistrySubscriberTest.java
index 3f67b68..ed15d9d 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/state/subscriber/DataSourceStatusRegistrySubscriberTest.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/subscriber/DataSourceStatusRegistrySubscriberTest.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.subscriber;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.subscriber;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.node.StatesNode;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.node.StatusNode;
import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.apache.shardingsphere.infra.rule.event.impl.DataSourceDisabledEvent;
import
org.apache.shardingsphere.infra.rule.event.impl.PrimaryDataSourceChangedEvent;
@@ -50,7 +50,7 @@ public final class DataSourceStatusRegistrySubscriberTest {
String dataSourceName = "replica_ds_0";
DataSourceDisabledEvent dataSourceDisabledEvent = new
DataSourceDisabledEvent(schemaName, dataSourceName, isDisabled);
new
DataSourceStatusRegistrySubscriber(repository).update(dataSourceDisabledEvent);
- verify(repository).persist(StatesNode.getDataSourcePath(schemaName,
dataSourceName), value);
+ verify(repository).persist(StatusNode.getDataSourcePath(schemaName,
dataSourceName), value);
}
@Test
@@ -60,6 +60,6 @@ public final class DataSourceStatusRegistrySubscriberTest {
String dataSourceName = "replica_ds_0";
PrimaryDataSourceChangedEvent event = new
PrimaryDataSourceChangedEvent(schemaName, groupName, dataSourceName);
new DataSourceStatusRegistrySubscriber(repository).update(event);
-
verify(repository).persist(StatesNode.getPrimaryDataSourcePath(schemaName,
groupName), dataSourceName);
+
verify(repository).persist(StatusNode.getPrimaryDataSourcePath(schemaName,
groupName), dataSourceName);
}
}
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/state/watcher/DataSourceStateChangedWatcherTest.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/watcher/DataSourceStateChangedWatcherTest.java
similarity index 93%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/watcher/DataSourceStateChangedWatcherTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/watcher/DataSourceStateChangedWatcherTest.java
index 04bc322..e20856c 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/state/watcher/DataSourceStateChangedWatcherTest.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/watcher/DataSourceStateChangedWatcherTest.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.schema.ClusterSchema;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.event.DisabledStateChangedEvent;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.event.DisabledStateChangedEvent;
import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent.Type;
@@ -35,7 +35,7 @@ public final class DataSourceStateChangedWatcherTest {
@Test
public void assertCreateEvent() {
Optional<GovernanceEvent> actual = new
DataSourceStateChangedWatcher().createGovernanceEvent(
- new
DataChangedEvent("/states/datanodes/replica_query_db/replica_ds_0", "disabled",
Type.UPDATED));
+ new
DataChangedEvent("/status/datanodes/replica_query_db/replica_ds_0", "disabled",
Type.UPDATED));
assertTrue(actual.isPresent());
assertThat(((DisabledStateChangedEvent)
actual.get()).getClusterSchema().getSchemaName(), is(new
ClusterSchema("replica_query_db", "replica_ds_0").getSchemaName()));
}
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/state/watcher/TerminalStateChangedWatcherTest.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/watcher/TerminalStateChangedWatcherTest.java
similarity index 97%
rename from
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/state/watcher/TerminalStateChangedWatcherTest.java
rename to
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/watcher/TerminalStateChangedWatcherTest.java
index 5721be8..13435f4 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/state/watcher/TerminalStateChangedWatcherTest.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/watcher/TerminalStateChangedWatcherTest.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.watcher;
+package
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.watcher;
-import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.state.ResourceState;
+import
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.ResourceState;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent;
import
org.apache.shardingsphere.mode.repository.cluster.listener.DataChangedEvent.Type;
import org.apache.shardingsphere.infra.state.StateEvent;