This is an automated email from the ASF dual-hosted git repository.
crazyhzm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 310bf91 [DUBBO-3137]: step4 - remove ClusterConstants (#4065)
310bf91 is described below
commit 310bf91b38a2e1cafe64733d5bdf88ca3c9e4877
Author: Ian Luo <[email protected]>
AuthorDate: Wed May 15 18:19:12 2019 +0800
[DUBBO-3137]: step4 - remove ClusterConstants (#4065)
---
.../org/apache/dubbo/rpc/cluster/Configurator.java | 2 +-
.../java/org/apache/dubbo/rpc/cluster/Constants.java | 14 ++++----------
.../rpc/cluster/configurator/AbstractConfigurator.java | 4 ++--
.../rpc/cluster/configurator/parser/ConfigParser.java | 2 +-
.../rpc/cluster/loadbalance/AbstractLoadBalance.java | 10 +++++-----
.../rpc/cluster/router/condition/ConditionRouter.java | 10 +++++-----
.../rpc/cluster/router/file/FileRouterFactory.java | 8 ++++----
.../rpc/cluster/router/mock/MockInvokersSelector.java | 4 ++--
.../dubbo/rpc/cluster/router/script/ScriptRouter.java | 12 ++++++------
.../apache/dubbo/rpc/cluster/router/tag/TagRouter.java | 18 +++++++++---------
.../rpc/cluster/support/AbstractClusterInvoker.java | 12 ++++++------
.../apache/dubbo/rpc/cluster/support/ClusterUtils.java | 2 +-
.../rpc/cluster/support/FailbackClusterInvoker.java | 8 ++++----
.../rpc/cluster/support/FailoverClusterInvoker.java | 4 ++--
.../rpc/cluster/support/ForkingClusterInvoker.java | 4 ++--
.../cluster/support/wrapper/MockClusterInvoker.java | 2 +-
.../java/org/apache/dubbo/rpc/cluster/StickyTest.java | 2 +-
.../cluster/configurator/parser/ConfigParserTest.java | 6 +++---
.../rpc/cluster/directory/StaticDirectoryTest.java | 2 +-
.../rpc/cluster/loadbalance/LoadBalanceBaseTest.java | 4 ++--
.../cluster/router/condition/ConditionRouterTest.java | 4 ++--
.../rpc/cluster/router/file/FileRouterEngineTest.java | 2 +-
.../rpc/cluster/router/script/ScriptRouterTest.java | 2 +-
.../cluster/support/AbstractClusterInvokerTest.java | 4 ++--
.../dubbo/common/constants/RegistryConstants.java | 4 ++++
.../main/java/com/alibaba/dubbo/common/Constants.java | 5 ++---
.../apache/dubbo/config/AbstractInterfaceConfig.java | 2 +-
.../org/apache/dubbo/config/AbstractMethodConfig.java | 2 +-
.../apache/dubbo/config/AbstractReferenceConfig.java | 2 +-
.../org/apache/dubbo/config/annotation/Reference.java | 8 ++++----
.../org/apache/dubbo/config/annotation/Service.java | 10 +++++-----
.../dubbo/config/AbstractReferenceConfigTest.java | 2 +-
.../dubbo/config/spring/SimpleRegistryExporter.java | 2 +-
.../dubbo/registry/integration/RegistryDirectory.java | 2 +-
.../dubbo/registry/integration/RegistryProtocol.java | 6 +++---
.../dubbo/registry/dubbo/DubboRegistryFactory.java | 2 +-
.../dubbo/registry/dubbo/RegistryDirectoryTest.java | 12 ++++++------
.../dubbo/registry/dubbo/SimpleRegistryExporter.java | 2 +-
.../main/java/org/apache/dubbo/rpc/RpcConstants.java | 5 ++---
.../org/apache/dubbo/rpc/filter/ContextFilter.java | 2 +-
40 files changed, 103 insertions(+), 107 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Configurator.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Configurator.java
index dd6b4ba..24e5683 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Configurator.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Configurator.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
-import static org.apache.dubbo.common.constants.ClusterConstants.PRIORITY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.PRIORITY_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_KEY;
import static
org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ClusterConstants.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
similarity index 91%
rename from
dubbo-common/src/main/java/org/apache/dubbo/common/constants/ClusterConstants.java
rename to
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
index 269fd75..8849c26 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/ClusterConstants.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
@@ -14,15 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.apache.dubbo.rpc.cluster;
-package org.apache.dubbo.common.constants;
-
-public interface ClusterConstants {
- /**
- * key for router type, for e.g., "script"/"file", corresponding to
ScriptRouterFactory.NAME, FileRouterFactory.NAME
- */
- String ROUTER_KEY = "router";
-
+public interface Constants {
String LOADBALANCE_KEY = "loadbalance";
String DEFAULT_LOADBALANCE = "random";
@@ -95,8 +89,6 @@ public interface ClusterConstants {
String RUNTIME_KEY = "runtime";
- String TAG_KEY = "dubbo.tag";
-
String REMOTE_TIMESTAMP_KEY = "remote.timestamp";
String WARMUP_KEY = "warmup";
@@ -106,4 +98,6 @@ public interface ClusterConstants {
String CONFIG_VERSION_KEY = "configVersion";
String OVERRIDE_PROVIDERS_KEY = "providerAddresses";
+
+ String TAG_KEY = "dubbo.tag";
}
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
index 306a720..cc8b7c0 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/AbstractConfigurator.java
@@ -26,8 +26,8 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CONFIG_VERSION_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.OVERRIDE_PROVIDERS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CONFIG_VERSION_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.OVERRIDE_PROVIDERS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.ANY_VALUE;
import static
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParser.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParser.java
index 5b6f457..349c9f6 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParser.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParser.java
@@ -30,7 +30,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import static
org.apache.dubbo.common.constants.ClusterConstants.OVERRIDE_PROVIDERS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.OVERRIDE_PROVIDERS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static
org.apache.dubbo.common.constants.RegistryConstants.APP_DYNAMIC_CONFIGURATORS_CATEGORY;
import static
org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_CONFIGURATORS_CATEGORY;
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
index 9ca40e3..ed6f3c4 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
@@ -24,11 +24,11 @@ import org.apache.dubbo.rpc.cluster.LoadBalance;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_WARMUP;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_WEIGHT;
-import static
org.apache.dubbo.common.constants.ClusterConstants.REMOTE_TIMESTAMP_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.WARMUP_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.WEIGHT_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WARMUP;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WEIGHT;
+import static org.apache.dubbo.rpc.cluster.Constants.REMOTE_TIMESTAMP_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.WARMUP_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.WEIGHT_KEY;
/**
* AbstractLoadBalance
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
index f69b185..5fe8202 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
@@ -38,11 +38,11 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import static org.apache.dubbo.common.constants.ClusterConstants.ADDRESS_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.FORCE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.PRIORITY_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RUNTIME_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.ADDRESS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.FORCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.PRIORITY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RUNTIME_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX;
import static org.apache.dubbo.common.constants.CommonConstants.ENABLED_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterFactory.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterFactory.java
index 7ad7fc7..13e929c 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterFactory.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterFactory.java
@@ -27,10 +27,10 @@ import java.io.File;
import java.io.FileReader;
import java.io.IOException;
-import static org.apache.dubbo.common.constants.ClusterConstants.ROUTER_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RUNTIME_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.TYPE_KEY;
+import static org.apache.dubbo.common.constants.RegistryConstants.ROUTER_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RUNTIME_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TYPE_KEY;
public class FileRouterFactory implements RouterFactory {
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mock/MockInvokersSelector.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mock/MockInvokersSelector.java
index 76fa6de..c20c5f3 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mock/MockInvokersSelector.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/mock/MockInvokersSelector.java
@@ -26,8 +26,8 @@ import org.apache.dubbo.rpc.cluster.router.AbstractRouter;
import java.util.ArrayList;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.INVOCATION_NEED_MOCK;
-import static org.apache.dubbo.common.constants.ClusterConstants.MOCK_PROTOCOL;
+import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
+import static org.apache.dubbo.rpc.cluster.Constants.MOCK_PROTOCOL;
/**
* A specific Router designed to realize mock feature.
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouter.java
index c73d9a9..8d66a9e 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouter.java
@@ -39,12 +39,12 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_SCRIPT_TYPE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.FORCE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.PRIORITY_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RUNTIME_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.TYPE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_SCRIPT_TYPE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.FORCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.PRIORITY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RUNTIME_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TYPE_KEY;
/**
* ScriptRouter
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
index 67ab112..d4cf9df 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java
@@ -17,7 +17,6 @@
package org.apache.dubbo.rpc.cluster.router.tag;
import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.constants.ClusterConstants;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
@@ -31,6 +30,7 @@ import org.apache.dubbo.configcenter.DynamicConfiguration;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
+import org.apache.dubbo.rpc.cluster.Constants;
import org.apache.dubbo.rpc.cluster.router.AbstractRouter;
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRouterRule;
import org.apache.dubbo.rpc.cluster.router.tag.model.TagRuleParser;
@@ -40,7 +40,7 @@ import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
-import static org.apache.dubbo.common.constants.ClusterConstants.TAG_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.FORCE_USE_TAG;
/**
@@ -97,8 +97,8 @@ public class TagRouter extends AbstractRouter implements
ConfigurationListener {
}
List<Invoker<T>> result = invokers;
- String tag =
StringUtils.isEmpty(invocation.getAttachment(ClusterConstants.TAG_KEY)) ?
url.getParameter(ClusterConstants.TAG_KEY) :
- invocation.getAttachment(ClusterConstants.TAG_KEY);
+ String tag =
StringUtils.isEmpty(invocation.getAttachment(Constants.TAG_KEY)) ?
url.getParameter(Constants.TAG_KEY) :
+ invocation.getAttachment(Constants.TAG_KEY);
// if we are requesting for a Provider with a specific tag
if (StringUtils.isNotEmpty(tag)) {
@@ -113,7 +113,7 @@ public class TagRouter extends AbstractRouter implements
ConfigurationListener {
} else {
// dynamic tag group doesn't have any item about the requested
app OR it's null after filtered by
// dynamic tag group but force=false. check static tag
- result = filterInvoker(invokers, invoker ->
tag.equals(invoker.getUrl().getParameter(ClusterConstants.TAG_KEY)));
+ result = filterInvoker(invokers, invoker ->
tag.equals(invoker.getUrl().getParameter(Constants.TAG_KEY)));
}
// If there's no tagged providers that can match the current
tagged request. force.tag is set by default
// to false, which means it will invoke any providers without a
tag unless it's explicitly disallowed.
@@ -124,7 +124,7 @@ public class TagRouter extends AbstractRouter implements
ConfigurationListener {
else {
List<Invoker<T>> tmp = filterInvoker(invokers, invoker ->
addressNotMatches(invoker.getUrl(),
tagRouterRuleCopy.getAddresses()));
- return filterInvoker(tmp, invoker ->
StringUtils.isEmpty(invoker.getUrl().getParameter(ClusterConstants.TAG_KEY)));
+ return filterInvoker(tmp, invoker ->
StringUtils.isEmpty(invoker.getUrl().getParameter(Constants.TAG_KEY)));
}
} else {
// List<String> addresses = tagRouterRule.filter(providerApp);
@@ -140,7 +140,7 @@ public class TagRouter extends AbstractRouter implements
ConfigurationListener {
// static tag group.
}
return filterInvoker(result, invoker -> {
- String localTag =
invoker.getUrl().getParameter(ClusterConstants.TAG_KEY);
+ String localTag =
invoker.getUrl().getParameter(Constants.TAG_KEY);
return StringUtils.isEmpty(localTag) ||
!tagRouterRuleCopy.getTagNames().contains(localTag);
});
}
@@ -163,8 +163,8 @@ public class TagRouter extends AbstractRouter implements
ConfigurationListener {
private <T> List<Invoker<T>> filterUsingStaticTag(List<Invoker<T>>
invokers, URL url, Invocation invocation) {
List<Invoker<T>> result = invokers;
// Dynamic param
- String tag =
StringUtils.isEmpty(invocation.getAttachment(ClusterConstants.TAG_KEY)) ?
url.getParameter(ClusterConstants.TAG_KEY) :
- invocation.getAttachment(ClusterConstants.TAG_KEY);
+ String tag =
StringUtils.isEmpty(invocation.getAttachment(Constants.TAG_KEY)) ?
url.getParameter(Constants.TAG_KEY) :
+ invocation.getAttachment(Constants.TAG_KEY);
// Tag request
if (!StringUtils.isEmpty(tag)) {
result = filterInvoker(invokers, invoker ->
tag.equals(invoker.getUrl().getParameter(TAG_KEY)));
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
index 922f4dc..db2d401 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
@@ -39,12 +39,12 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_AVAILABLE_CHECK_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_CLUSTER_AVAILABLE_CHECK;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_CLUSTER_STICKY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_LOADBALANCE;
-import static
org.apache.dubbo.common.constants.ClusterConstants.LOADBALANCE_KEY;
+import static
org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
+import static
org.apache.dubbo.rpc.cluster.Constants.DEFAULT_CLUSTER_AVAILABLE_CHECK;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_CLUSTER_STICKY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_LOADBALANCE;
+import static org.apache.dubbo.rpc.cluster.Constants.LOADBALANCE_KEY;
/**
* AbstractClusterInvoker
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ClusterUtils.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ClusterUtils.java
index a3418ad..93d2b6b 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ClusterUtils.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ClusterUtils.java
@@ -23,7 +23,7 @@ import org.apache.dubbo.common.utils.StringUtils;
import java.util.HashMap;
import java.util.Map;
-import static org.apache.dubbo.common.constants.ClusterConstants.TAG_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ALIVE_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.CORE_THREADS_KEY;
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailbackClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailbackClusterInvoker.java
index f4ad2ad..a17c4ab 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailbackClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailbackClusterInvoker.java
@@ -35,10 +35,10 @@ import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_FAILBACK_TIMES;
-import static org.apache.dubbo.common.constants.ClusterConstants.RETRIES_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_FAILBACK_TASKS;
-import static
org.apache.dubbo.common.constants.ClusterConstants.FAIL_BACK_TASKS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_FAILBACK_TIMES;
+import static org.apache.dubbo.rpc.cluster.Constants.RETRIES_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_FAILBACK_TASKS;
+import static org.apache.dubbo.rpc.cluster.Constants.FAIL_BACK_TASKS_KEY;
/**
* When fails, record failure requests and schedule for retry on a regular
interval.
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailoverClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailoverClusterInvoker.java
index bb3fecd..7725447 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailoverClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailoverClusterInvoker.java
@@ -34,8 +34,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_RETRIES;
-import static org.apache.dubbo.common.constants.ClusterConstants.RETRIES_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_RETRIES;
+import static org.apache.dubbo.rpc.cluster.Constants.RETRIES_KEY;
/**
* When invoke fails, log the initial error and retry other invokers (retry n
times, which means at most n different invokers will be invoked)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ForkingClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ForkingClusterInvoker.java
index bb44b0b..70a6eaa 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ForkingClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ForkingClusterInvoker.java
@@ -34,8 +34,8 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-import static org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_FORKS;
-import static org.apache.dubbo.common.constants.ClusterConstants.FORKS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_FORKS;
+import static org.apache.dubbo.rpc.cluster.Constants.FORKS_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.DEFAULT_TIMEOUT;
import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY;
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
index d2db919..c9e7ac6 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
@@ -32,7 +32,7 @@ import org.apache.dubbo.rpc.support.MockInvoker;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.INVOCATION_NEED_MOCK;
+import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.common.constants.RpcConstants.MOCK_KEY;
public class MockClusterInvoker<T> implements Invoker<T> {
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/StickyTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/StickyTest.java
index 6b093b9..878e374 100644
--- a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/StickyTest.java
+++ b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/StickyTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParserTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParserTest.java
index 9f4eb1b..364a813 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParserTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/configurator/parser/ConfigParserTest.java
@@ -30,9 +30,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.LOADBALANCE_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.OVERRIDE_PROVIDERS_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.WEIGHT_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.LOADBALANCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.OVERRIDE_PROVIDERS_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.WEIGHT_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY;
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java
index 03e611e..7ce8f4a 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
/**
* StaticDirectory Test
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java
index 47419fd..fef733a 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java
@@ -37,8 +37,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_WARMUP;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_WEIGHT;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WARMUP;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WEIGHT;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouterTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouterTest.java
index eb3d28d..bf378f0 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouterTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouterTest.java
@@ -33,8 +33,8 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
-import static org.apache.dubbo.common.constants.ClusterConstants.FORCE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.FORCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
public class ConditionRouterTest {
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterEngineTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterEngineTest.java
index ef7c37b..6350148 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterEngineTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/file/FileRouterEngineTest.java
@@ -40,7 +40,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import static org.apache.dubbo.common.constants.ClusterConstants.RUNTIME_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RUNTIME_KEY;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterTest.java
index 29b29d1..f52347f 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouterTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
public class ScriptRouterTest {
diff --git
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
index 6f0b37b7..de191d7 100644
---
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
+++
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
@@ -47,8 +47,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_AVAILABLE_CHECK_KEY;
-import static
org.apache.dubbo.common.constants.ClusterConstants.INVOCATION_NEED_MOCK;
+import static
org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.MonitorConstants.MONITOR_KEY;
import static org.mockito.BDDMockito.given;
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
index d8bf701..d04856f 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
+++
b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java
@@ -129,4 +129,8 @@ public interface RegistryConstants {
String SESSION_TIMEOUT_KEY = "session";
int DEFAULT_SESSION_TIMEOUT = 60 * 1000;
+ /**
+ * key for router type, for e.g., "script"/"file", corresponding to
ScriptRouterFactory.NAME, FileRouterFactory.NAME
+ */
+ String ROUTER_KEY = "router";
}
diff --git
a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/Constants.java
b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/Constants.java
index b862f9e..f447d29 100644
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/Constants.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/Constants.java
@@ -17,7 +17,6 @@
package com.alibaba.dubbo.common;
-import org.apache.dubbo.common.constants.ClusterConstants;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.constants.ConfigConstants;
import org.apache.dubbo.common.constants.FilterConstants;
@@ -27,6 +26,6 @@ import org.apache.dubbo.common.constants.RemotingConstants;
import org.apache.dubbo.common.constants.RpcConstants;
@Deprecated
-public class Constants implements ClusterConstants, CommonConstants,
ConfigConstants, FilterConstants,
- MonitorConstants, RegistryConstants, RemotingConstants, RpcConstants {
+public class Constants implements CommonConstants, ConfigConstants,
FilterConstants,
+ MonitorConstants, RegistryConstants, RemotingConstants, RpcConstants,
org.apache.dubbo.rpc.cluster.Constants {
}
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
index cd04ac8..d0bcb4d 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java
@@ -53,7 +53,7 @@ import java.util.Map;
import java.util.Set;
import static
org.apache.dubbo.common.config.ConfigurationUtils.parseProperties;
-import static org.apache.dubbo.common.constants.ClusterConstants.TAG_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static
org.apache.dubbo.common.constants.CommonConstants.COMMA_SEPARATOR;
import static
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java
index d6d0086..42e4ca9 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractMethodConfig.java
@@ -21,7 +21,7 @@ import org.apache.dubbo.rpc.cluster.LoadBalance;
import java.util.Map;
-import static
org.apache.dubbo.common.constants.ClusterConstants.LOADBALANCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.LOADBALANCE_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.FAIL_PREFIX;
import static org.apache.dubbo.common.constants.RpcConstants.FORCE_PREFIX;
import static org.apache.dubbo.common.constants.RpcConstants.MOCK_KEY;
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java
index 80409f2..7fe8dc4 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java
@@ -21,7 +21,7 @@ import org.apache.dubbo.config.support.Parameter;
import org.apache.dubbo.rpc.InvokerListener;
import org.apache.dubbo.rpc.support.ProtocolUtils;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static
org.apache.dubbo.common.constants.ConfigConstants.LAZY_CONNECT_KEY;
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java
index 9ad68c1..d6e9344 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Reference.java
@@ -16,11 +16,11 @@
*/
package org.apache.dubbo.config.annotation;
-import org.apache.dubbo.common.constants.ClusterConstants;
import org.apache.dubbo.common.constants.RemotingConstants;
import org.apache.dubbo.common.constants.RpcConstants;
import org.apache.dubbo.rpc.ExporterListener;
import org.apache.dubbo.rpc.Filter;
+import org.apache.dubbo.rpc.cluster.Constants;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -110,7 +110,7 @@ public @interface Reference {
/**
* Whether to stick to the same node in the cluster, the default value is
false
*
- * @see ClusterConstants#DEFAULT_CLUSTER_STICKY
+ * @see Constants#DEFAULT_CLUSTER_STICKY
*/
boolean sticky() default false;
@@ -164,14 +164,14 @@ public @interface Reference {
/**
* Service invocation retry times
*
- * @see ClusterConstants#DEFAULT_RETRIES
+ * @see Constants#DEFAULT_RETRIES
*/
int retries() default 2;
/**
* Load balance strategy, legal values include: random, roundrobin,
leastactive
*
- * @see ClusterConstants#DEFAULT_LOADBALANCE
+ * @see Constants#DEFAULT_LOADBALANCE
*/
String loadbalance() default "";
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Service.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Service.java
index 5605471..f743386 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Service.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/annotation/Service.java
@@ -16,10 +16,10 @@
*/
package org.apache.dubbo.config.annotation;
-import org.apache.dubbo.common.constants.ClusterConstants;
import org.apache.dubbo.common.constants.RpcConstants;
import org.apache.dubbo.rpc.ExporterListener;
import org.apache.dubbo.rpc.Filter;
+import org.apache.dubbo.rpc.cluster.Constants;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -28,8 +28,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_LOADBALANCE;
-import static
org.apache.dubbo.common.constants.ClusterConstants.DEFAULT_RETRIES;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_LOADBALANCE;
+import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_RETRIES;
/**
* Service annotation
@@ -173,14 +173,14 @@ public @interface Service {
/**
* Service invocation retry times
*
- * @see ClusterConstants#DEFAULT_RETRIES
+ * @see Constants#DEFAULT_RETRIES
*/
int retries() default DEFAULT_RETRIES;
/**
* Load balance strategy, legal values include: random, roundrobin,
leastactive
*
- * @see ClusterConstants#DEFAULT_LOADBALANCE
+ * @see Constants#DEFAULT_LOADBALANCE
*/
String loadbalance() default DEFAULT_LOADBALANCE;
diff --git
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractReferenceConfigTest.java
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractReferenceConfigTest.java
index 6368389..ab40eb1 100644
---
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractReferenceConfigTest.java
+++
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractReferenceConfigTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static
org.apache.dubbo.common.constants.RpcConstants.INVOKER_LISTENER_KEY;
import static
org.apache.dubbo.common.constants.RpcConstants.REFERENCE_FILTER_KEY;
import static org.apache.dubbo.common.constants.RpcConstants.STUB_EVENT_KEY;
diff --git
a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/SimpleRegistryExporter.java
b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/SimpleRegistryExporter.java
index 4f7ea52..38f57ab 100644
---
a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/SimpleRegistryExporter.java
+++
b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/SimpleRegistryExporter.java
@@ -27,7 +27,7 @@ import org.apache.dubbo.rpc.ProxyFactory;
import java.io.IOException;
import java.net.ServerSocket;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static
org.apache.dubbo.common.constants.RpcConstants.CALLBACK_INSTANCES_LIMIT_KEY;
diff --git
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
index 327b5c0..20c8b09 100644
---
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
+++
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
@@ -58,7 +58,7 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
-import static org.apache.dubbo.common.constants.ClusterConstants.ROUTER_KEY;
+import static org.apache.dubbo.common.constants.RegistryConstants.ROUTER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANY_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.DISABLED_KEY;
diff --git
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
index 69173d9..780d4bc 100644
---
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
+++
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
@@ -52,9 +52,9 @@ import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import static java.util.concurrent.Executors.newSingleThreadExecutor;
-import static
org.apache.dubbo.common.constants.ClusterConstants.LOADBALANCE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.WARMUP_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.WEIGHT_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.LOADBALANCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.WARMUP_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.WEIGHT_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANY_VALUE;
import static
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
diff --git
a/dubbo-registry/dubbo-registry-default/src/main/java/org/apache/dubbo/registry/dubbo/DubboRegistryFactory.java
b/dubbo-registry/dubbo-registry-default/src/main/java/org/apache/dubbo/registry/dubbo/DubboRegistryFactory.java
index 5a3f6ab..1728e14 100644
---
a/dubbo-registry/dubbo-registry-default/src/main/java/org/apache/dubbo/registry/dubbo/DubboRegistryFactory.java
+++
b/dubbo-registry/dubbo-registry-default/src/main/java/org/apache/dubbo/registry/dubbo/DubboRegistryFactory.java
@@ -36,7 +36,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
diff --git
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryDirectoryTest.java
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryDirectoryTest.java
index 77616c4..b3cb0de 100644
---
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryDirectoryTest.java
+++
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryDirectoryTest.java
@@ -49,12 +49,12 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
-import static
org.apache.dubbo.common.constants.ClusterConstants.INVOCATION_NEED_MOCK;
-import static
org.apache.dubbo.common.constants.ClusterConstants.LOADBALANCE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.MOCK_PROTOCOL;
-import static org.apache.dubbo.common.constants.ClusterConstants.ROUTER_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.RULE_KEY;
-import static org.apache.dubbo.common.constants.ClusterConstants.TYPE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
+import static org.apache.dubbo.rpc.cluster.Constants.LOADBALANCE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.MOCK_PROTOCOL;
+import static org.apache.dubbo.common.constants.RegistryConstants.ROUTER_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.RULE_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TYPE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER_SIDE;
diff --git
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/SimpleRegistryExporter.java
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/SimpleRegistryExporter.java
index d07c815..785cf52 100644
---
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/SimpleRegistryExporter.java
+++
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/SimpleRegistryExporter.java
@@ -27,7 +27,7 @@ import org.apache.dubbo.rpc.ProxyFactory;
import java.io.IOException;
import java.net.ServerSocket;
-import static
org.apache.dubbo.common.constants.ClusterConstants.CLUSTER_STICKY_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static
org.apache.dubbo.common.constants.RpcConstants.CALLBACK_INSTANCES_LIMIT_KEY;
diff --git
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcConstants.java
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcConstants.java
index 7d592b1..8a3b60d 100644
---
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcConstants.java
+++
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcConstants.java
@@ -16,7 +16,6 @@
*/
package org.apache.dubbo.rpc;
-import org.apache.dubbo.common.constants.ClusterConstants;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.constants.ConfigConstants;
import org.apache.dubbo.common.constants.FilterConstants;
@@ -30,8 +29,8 @@ import org.apache.dubbo.common.constants.RemotingConstants;
* @deprecated Replace to org.apache.dubbo.common.Constants
*/
@Deprecated
-public final class RpcConstants implements ClusterConstants, CommonConstants,
ConfigConstants, FilterConstants,
- MonitorConstants, RegistryConstants, RemotingConstants,
org.apache.dubbo.common.constants.RpcConstants {
+public final class RpcConstants implements CommonConstants, ConfigConstants,
FilterConstants, MonitorConstants,
+ RegistryConstants, RemotingConstants,
org.apache.dubbo.common.constants.RpcConstants {
private RpcConstants() {
}
diff --git
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ContextFilter.java
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ContextFilter.java
index 99596bf..1d04b8a 100644
---
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ContextFilter.java
+++
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ContextFilter.java
@@ -28,7 +28,6 @@ import org.apache.dubbo.rpc.RpcInvocation;
import java.util.HashMap;
import java.util.Map;
-import static org.apache.dubbo.common.constants.ClusterConstants.TAG_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY;
@@ -50,6 +49,7 @@ import static
org.apache.dubbo.common.constants.RpcConstants.TOKEN_KEY;
*/
@Activate(group = PROVIDER, order = -10000)
public class ContextFilter implements Filter {
+ private static final String TAG_KEY = "dubbo.tag";
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws
RpcException {