Skip to content

Commit d0d1a65

Browse files
beiwei30CrazyHZM
authored andcommitted
[DUBBO-3137]: move more constants out of ConfigConstants (#4092)
1 parent 23903ba commit d0d1a65

File tree

36 files changed

+115
-82
lines changed

36 files changed

+115
-82
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.List;
3232
import java.util.Map;
3333

34-
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
34+
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
3535
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
3636
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;
3737

dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
5151
import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
52-
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
52+
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
5353
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
5454
import static org.mockito.BDDMockito.given;
5555
import static org.mockito.Mockito.mock;

dubbo-common/src/main/java/org/apache/dubbo/common/constants/ConfigConstants.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
public interface ConfigConstants {
2424
String CLUSTER_KEY = "cluster";
2525

26-
String CONFIG_CLUSTER_KEY = "config.cluster";
27-
String CONFIG_NAMESPACE_KEY = "config.namespace";
28-
String CONFIG_GROUP_KEY = "config.group";
29-
String CONFIG_CHECK_KEY = "config.check";
30-
3126
String USERNAME_KEY = "username";
3227

3328
String PASSWORD_KEY = "password";
@@ -36,42 +31,15 @@ public interface ConfigConstants {
3631

3732
String PORT_KEY = "port";
3833

39-
String REGISTER_IP_KEY = "register.ip";
40-
4134
String DUBBO_IP_TO_BIND = "DUBBO_IP_TO_BIND";
4235

43-
String SCOPE_KEY = "scope";
44-
45-
String SCOPE_LOCAL = "local";
46-
47-
String SCOPE_REMOTE = "remote";
48-
4936
@Deprecated
5037
String SHUTDOWN_WAIT_SECONDS_KEY = "dubbo.service.shutdown.wait.seconds";
5138

5239
String SHUTDOWN_WAIT_KEY = "dubbo.service.shutdown.wait";
5340

54-
/**
55-
* The key name for export URL in register center
56-
*/
57-
String EXPORT_KEY = "export";
58-
59-
/**
60-
* The key name for reference URL in register center
61-
*/
62-
String REFER_KEY = "refer";
63-
64-
/**
65-
* To decide whether to make connection when the client is created
66-
*/
67-
String LAZY_CONNECT_KEY = "lazy";
68-
6941
String DUBBO_PROTOCOL = "dubbo";
7042

71-
String ZOOKEEPER_PROTOCOL = "zookeeper";
72-
73-
String TELNET = "telnet";
74-
7543
String QOS_ENABLE = "qos.enable";
7644

7745
String QOS_PORT = "qos.port";

dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,13 @@ public interface RegistryConstants {
133133
* key for router type, for e.g., "script"/"file", corresponding to ScriptRouterFactory.NAME, FileRouterFactory.NAME
134134
*/
135135
String ROUTER_KEY = "router";
136+
137+
/**
138+
* The key name for export URL in register center
139+
*/
140+
String EXPORT_KEY = "export";
141+
/**
142+
* The key name for reference URL in register center
143+
*/
144+
String REFER_KEY = "refer";
136145
}

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
7070
import static org.apache.dubbo.config.Constants.LAYER_KEY;
7171
import static org.apache.dubbo.config.Constants.LISTENER_KEY;
72-
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
73-
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
72+
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
73+
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
7474
import static org.apache.dubbo.config.Constants.REGISTRIES_SUFFIX;
7575
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_KEY;
7676
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_SECONDS_KEY;

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractReferenceConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
2525
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
2626
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
27-
import static org.apache.dubbo.common.constants.ConfigConstants.LAZY_CONNECT_KEY;
27+
import static org.apache.dubbo.rpc.Constants.LAZY_CONNECT_KEY;
2828
import static org.apache.dubbo.rpc.Constants.INVOKER_LISTENER_KEY;
2929
import static org.apache.dubbo.rpc.Constants.REFERENCE_FILTER_KEY;
3030
import static org.apache.dubbo.rpc.Constants.STUB_EVENT_KEY;

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
3030
import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY;
3131
import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY;
32-
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CHECK_KEY;
33-
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CLUSTER_KEY;
34-
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_GROUP_KEY;
35-
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
36-
import static org.apache.dubbo.common.constants.ConfigConstants.ZOOKEEPER_PROTOCOL;
32+
import static org.apache.dubbo.configcenter.Constants.CONFIG_CHECK_KEY;
33+
import static org.apache.dubbo.configcenter.Constants.CONFIG_CLUSTER_KEY;
34+
import static org.apache.dubbo.configcenter.Constants.CONFIG_GROUP_KEY;
35+
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;
36+
import static org.apache.dubbo.config.Constants.ZOOKEEPER_PROTOCOL;
3737
import static org.apache.dubbo.config.Constants.CONFIG_CONFIGFILE_KEY;
3838
import static org.apache.dubbo.config.Constants.CONFIG_ENABLE_KEY;
3939
import static org.apache.dubbo.config.Constants.CONFIG_TIMEOUT_KEY;

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/Constants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@ public interface Constants {
113113

114114
String REGISTRIES_SUFFIX = "dubbo.registries.";
115115

116+
String ZOOKEEPER_PROTOCOL = "zookeeper";
116117
}

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProtocolConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
3737
import static org.apache.dubbo.common.constants.ConfigConstants.HOST_KEY;
3838
import static org.apache.dubbo.config.Constants.PROTOCOLS_SUFFIX;
39-
import static org.apache.dubbo.common.constants.ConfigConstants.TELNET;
39+
import static org.apache.dubbo.remoting.Constants.TELNET;
4040
import static org.apache.dubbo.common.constants.RpcConstants.DUBBO_VERSION_KEY;
4141

4242
/**

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProviderConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import static org.apache.dubbo.common.constants.CommonConstants.THREADPOOL_KEY;
3232
import static org.apache.dubbo.config.Constants.CONTEXTPATH_KEY;
3333
import static org.apache.dubbo.config.Constants.STATUS_KEY;
34-
import static org.apache.dubbo.common.constants.ConfigConstants.TELNET;
34+
import static org.apache.dubbo.remoting.Constants.TELNET;
3535

3636
/**
3737
* The service provider default configuration

0 commit comments

Comments
 (0)