You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/02/13 06:01:35 UTC

(shardingsphere) branch master updated: Rename DatabaseRuleRootNodePath (#34657)

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

zhangliang 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 c60b06ec686 Rename DatabaseRuleRootNodePath (#34657)
c60b06ec686 is described below

commit c60b06ec686fedda93111c8a0821da9b8db4ac37
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Feb 13 14:01:30 2025 +0800

    Rename DatabaseRuleRootNodePath (#34657)
---
 .../mode/node/path/config/database/DatabaseRuleNodePath.java   |  6 +++---
 .../node/path/config/database/item/NamedRuleItemNodePath.java  |  4 ++--
 .../node/path/config/database/item/UniqueRuleItemNodePath.java | 10 +++++-----
 .../{RuleRootNodePath.java => DatabaseRuleRootNodePath.java}   |  6 +++---
 .../path/config/database/item/NamedRuleItemNodePathTest.java   |  4 ++--
 .../path/config/database/item/UniqueRuleItemNodePathTest.java  |  6 +++---
 ...RootNodePathTest.java => DatabaseRuleRootNodePathTest.java} |  4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/DatabaseRuleNodePath.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/DatabaseRuleNodePath.java
index d543d19b041..d2f3b92f4df 100644
--- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/DatabaseRuleNodePath.java
+++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/DatabaseRuleNodePath.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.mode.node.path.config.database;
 import lombok.Getter;
 import org.apache.shardingsphere.mode.node.path.config.database.item.NamedRuleItemNodePath;
 import org.apache.shardingsphere.mode.node.path.config.database.item.UniqueRuleItemNodePath;
-import org.apache.shardingsphere.mode.node.path.config.database.root.RuleRootNodePath;
+import org.apache.shardingsphere.mode.node.path.config.database.root.DatabaseRuleRootNodePath;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -32,14 +32,14 @@ import java.util.Map;
 @Getter
 public final class DatabaseRuleNodePath {
     
-    private final RuleRootNodePath root;
+    private final DatabaseRuleRootNodePath root;
     
     private final Map<String, NamedRuleItemNodePath> namedItems;
     
     private final Map<String, UniqueRuleItemNodePath> uniqueItems;
     
     public DatabaseRuleNodePath(final String ruleType, final Collection<String> namedRuleItemNodePathTypes, final Collection<String> uniqueRuleItemNodePathTypes) {
-        root = new RuleRootNodePath(ruleType);
+        root = new DatabaseRuleRootNodePath(ruleType);
         namedItems = getNamedRuleItemNodePathMap(namedRuleItemNodePathTypes);
         uniqueItems = getUniqueRuleItemNodePathMap(uniqueRuleItemNodePathTypes);
     }
diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePath.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePath.java
index e3765608e44..e469c543fa0 100644
--- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePath.java
+++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePath.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.mode.node.path.config.database.item;
 
 import lombok.Getter;
 import org.apache.shardingsphere.mode.node.path.NodePathPattern;
-import org.apache.shardingsphere.mode.node.path.config.database.root.RuleRootNodePath;
+import org.apache.shardingsphere.mode.node.path.config.database.root.DatabaseRuleRootNodePath;
 import org.apache.shardingsphere.mode.node.path.version.VersionNodePathParser;
 
 import java.util.Optional;
@@ -38,7 +38,7 @@ public final class NamedRuleItemNodePath {
     @Getter
     private final VersionNodePathParser versionNodePathParser;
     
-    public NamedRuleItemNodePath(final RuleRootNodePath rootNodePath, final String type) {
+    public NamedRuleItemNodePath(final DatabaseRuleRootNodePath rootNodePath, final String type) {
         this.type = type;
         String pattern = String.join("/", rootNodePath.getNodePrefix() + type, NodePathPattern.GROUPED_IDENTIFIER);
         versionNodePathParser = new VersionNodePathParser(pattern);
diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePath.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePath.java
index f006139a324..583845ea57a 100644
--- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePath.java
+++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePath.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.mode.node.path.config.database.item;
 
 import lombok.Getter;
-import org.apache.shardingsphere.mode.node.path.config.database.root.RuleRootNodePath;
+import org.apache.shardingsphere.mode.node.path.config.database.root.DatabaseRuleRootNodePath;
 import org.apache.shardingsphere.mode.node.path.version.VersionNodePathParser;
 
 /**
@@ -33,16 +33,16 @@ public final class UniqueRuleItemNodePath {
     @Getter
     private final VersionNodePathParser versionNodePathParser;
     
-    public UniqueRuleItemNodePath(final RuleRootNodePath ruleRootNodePath, final String type) {
+    public UniqueRuleItemNodePath(final DatabaseRuleRootNodePath databaseRuleRootNodePath, final String type) {
         parentNode = null;
         this.type = type;
-        versionNodePathParser = new VersionNodePathParser(ruleRootNodePath.getNodePrefix() + type);
+        versionNodePathParser = new VersionNodePathParser(databaseRuleRootNodePath.getNodePrefix() + type);
     }
     
-    public UniqueRuleItemNodePath(final RuleRootNodePath ruleRootNodePath, final String parentNode, final String type) {
+    public UniqueRuleItemNodePath(final DatabaseRuleRootNodePath databaseRuleRootNodePath, final String parentNode, final String type) {
         this.parentNode = parentNode;
         this.type = type;
-        versionNodePathParser = new VersionNodePathParser(String.join("/", ruleRootNodePath.getNodePrefix() + parentNode, type));
+        versionNodePathParser = new VersionNodePathParser(String.join("/", databaseRuleRootNodePath.getNodePrefix() + parentNode, type));
     }
     
     /**
diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePath.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePath.java
similarity index 92%
rename from mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePath.java
rename to mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePath.java
index 2dec24d18df..daf3cb24dc6 100644
--- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePath.java
+++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePath.java
@@ -23,9 +23,9 @@ import org.apache.shardingsphere.mode.node.path.NodePathPattern;
 import java.util.regex.Pattern;
 
 /**
- * Rule root node path.
+ * Database rule root node path.
  */
-public final class RuleRootNodePath {
+public final class DatabaseRuleRootNodePath {
     
     private static final String ROOT_NODE = "/metadata";
     
@@ -39,7 +39,7 @@ public final class RuleRootNodePath {
     
     private final Pattern pathPattern;
     
-    public RuleRootNodePath(final String ruleType) {
+    public DatabaseRuleRootNodePath(final String ruleType) {
         this.ruleType = ruleType;
         nodePrefix = String.join("/", ROOT_NODE, NodePathPattern.IDENTIFIER, RULE_NODE, ruleType, "");
         pathPattern = Pattern.compile(nodePrefix + ".*");
diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePathTest.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePathTest.java
index 17e891f48c6..17ee11fa854 100644
--- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePathTest.java
+++ b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/NamedRuleItemNodePathTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.mode.node.path.config.database.item;
 
-import org.apache.shardingsphere.mode.node.path.config.database.root.RuleRootNodePath;
+import org.apache.shardingsphere.mode.node.path.config.database.root.DatabaseRuleRootNodePath;
 import org.junit.jupiter.api.Test;
 
 import java.util.Optional;
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 class NamedRuleItemNodePathTest {
     
-    private final NamedRuleItemNodePath nodePath = new NamedRuleItemNodePath(new RuleRootNodePath("foo"), "tables");
+    private final NamedRuleItemNodePath nodePath = new NamedRuleItemNodePath(new DatabaseRuleRootNodePath("foo"), "tables");
     
     @Test
     void assertGetPath() {
diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePathTest.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePathTest.java
index 229676dec84..914ec2fd45e 100644
--- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePathTest.java
+++ b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/item/UniqueRuleItemNodePathTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.mode.node.path.config.database.item;
 
-import org.apache.shardingsphere.mode.node.path.config.database.root.RuleRootNodePath;
+import org.apache.shardingsphere.mode.node.path.config.database.root.DatabaseRuleRootNodePath;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.is;
@@ -27,13 +27,13 @@ class UniqueRuleItemNodePathTest {
     
     @Test
     void assertPathWithNullParentNode() {
-        UniqueRuleItemNodePath uniqueRuleItemNodePath = new UniqueRuleItemNodePath(new RuleRootNodePath("foo"), "test_path");
+        UniqueRuleItemNodePath uniqueRuleItemNodePath = new UniqueRuleItemNodePath(new DatabaseRuleRootNodePath("foo"), "test_path");
         assertThat(uniqueRuleItemNodePath.getPath(), is("test_path"));
     }
     
     @Test
     void assertGetPathWithParentNode() {
-        UniqueRuleItemNodePath uniqueRuleItemNodePath = new UniqueRuleItemNodePath(new RuleRootNodePath("foo"), "test_parent", "test_path");
+        UniqueRuleItemNodePath uniqueRuleItemNodePath = new UniqueRuleItemNodePath(new DatabaseRuleRootNodePath("foo"), "test_parent", "test_path");
         assertThat(uniqueRuleItemNodePath.getPath(), is("test_parent/test_path"));
     }
 }
diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePathTest.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePathTest.java
similarity index 92%
rename from mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePathTest.java
rename to mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePathTest.java
index 9a5ffe5e7d7..ecbd9e23c64 100644
--- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/RuleRootNodePathTest.java
+++ b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/config/database/root/DatabaseRuleRootNodePathTest.java
@@ -24,9 +24,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-class RuleRootNodePathTest {
+class DatabaseRuleRootNodePathTest {
     
-    private final RuleRootNodePath nodePath = new RuleRootNodePath("foo");
+    private final DatabaseRuleRootNodePath nodePath = new DatabaseRuleRootNodePath("foo");
     
     @Test
     void assertGetRuleNodePrefix() {