This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new dafe86f Remove unused variables (#7844)
dafe86f is described below
commit dafe86fed1e614a4d6e566063a5155dd12c8253a
Author: 灼华 <[email protected]>
AuthorDate: Mon May 24 22:35:46 2021 +0800
Remove unused variables (#7844)
---
.../metadata/DynamicConfigurationServiceNameMapping.java | 10 ++--------
.../java/org/apache/dubbo/metadata/ServiceNameMapping.java | 2 +-
.../registry/client/metadata/MetadataServiceNameMapping.java | 12 ++----------
3 files changed, 5 insertions(+), 19 deletions(-)
diff --git
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/DynamicConfigurationServiceNameMapping.java
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/DynamicConfigurationServiceNameMapping.java
index 49f9539..48116b0 100644
---
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/DynamicConfigurationServiceNameMapping.java
+++
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/DynamicConfigurationServiceNameMapping.java
@@ -30,7 +30,6 @@ import java.util.Set;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
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.rpc.model.ApplicationModel.getName;
/**
@@ -48,8 +47,6 @@ public class DynamicConfigurationServiceNameMapping
implements ServiceNameMappin
public void map(URL url) {
String serviceInterface = url.getServiceInterface();
String group = url.getParameter(GROUP_KEY);
- String version = url.getParameter(VERSION_KEY);
- String protocol = url.getProtocol();
if (IGNORED_SERVICE_INTERFACES.contains(serviceInterface)) {
return;
@@ -64,7 +61,7 @@ public class DynamicConfigurationServiceNameMapping
implements ServiceNameMappin
String content = valueOf(System.currentTimeMillis());
execute(() -> {
- dynamicConfiguration.publishConfig(key,
ServiceNameMapping.buildGroup(serviceInterface, group, version, protocol),
content);
+ dynamicConfiguration.publishConfig(key,
ServiceNameMapping.buildGroup(serviceInterface), content);
if (logger.isInfoEnabled()) {
logger.info(String.format("Dubbo service[%s] mapped to
interface name[%s].",
group, serviceInterface));
@@ -75,15 +72,12 @@ public class DynamicConfigurationServiceNameMapping
implements ServiceNameMappin
@Override
public Set<String> getAndListen(URL url, MappingListener mappingListener) {
String serviceInterface = url.getServiceInterface();
- String group = url.getParameter(GROUP_KEY);
- String version = url.getParameter(VERSION_KEY);
- String protocol = url.getProtocol();
DynamicConfiguration dynamicConfiguration =
DynamicConfiguration.getDynamicConfiguration();
Set<String> serviceNames = new LinkedHashSet<>();
execute(() -> {
Set<String> keys = dynamicConfiguration
-
.getConfigKeys(ServiceNameMapping.buildGroup(serviceInterface, group, version,
protocol));
+
.getConfigKeys(ServiceNameMapping.buildGroup(serviceInterface));
if (CollectionUtils.isNotEmpty(keys)) {
serviceNames.addAll(keys);
}
diff --git
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/ServiceNameMapping.java
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/ServiceNameMapping.java
index f08a748..b7e37e1 100644
---
a/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/ServiceNameMapping.java
+++
b/dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/ServiceNameMapping.java
@@ -60,7 +60,7 @@ public interface ServiceNameMapping {
return getExtensionLoader(ServiceNameMapping.class).getExtension(name
== null ? CONFIG_MAPPING_TYPE : name);
}
- static String buildGroup(String serviceInterface, String group, String
version, String protocol) {
+ static String buildGroup(String serviceInterface) {
// the issue : https://github.com/apache/dubbo/issues/4671
// StringBuilder groupBuilder = new
StringBuilder(serviceInterface)
// .append(KEY_SEPARATOR).append(defaultString(group))
diff --git
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
index 4892b61..d449b47 100644
---
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
+++
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
@@ -30,8 +30,6 @@ import java.util.List;
import java.util.Set;
import static java.util.Arrays.asList;
-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.rpc.model.ApplicationModel.getName;
public class MetadataServiceNameMapping implements ServiceNameMapping {
@@ -40,26 +38,20 @@ public class MetadataServiceNameMapping implements
ServiceNameMapping {
@Override
public void map(URL url) {
String serviceInterface = url.getServiceInterface();
- String group = url.getParameter(GROUP_KEY);
- String version = url.getParameter(VERSION_KEY);
- String protocol = url.getProtocol();
if (IGNORED_SERVICE_INTERFACES.contains(serviceInterface)) {
return;
}
String registryCluster = getRegistryCluster(url);
MetadataReport metadataReport =
MetadataReportInstance.getMetadataReport(registryCluster);
-
metadataReport.registerServiceAppMapping(ServiceNameMapping.buildGroup(serviceInterface,
group, version, protocol), getName(), url);
+
metadataReport.registerServiceAppMapping(ServiceNameMapping.buildGroup(serviceInterface),
getName(), url);
}
@Override
public Set<String> getAndListen(URL url, MappingListener mappingListener) {
String serviceInterface = url.getServiceInterface();
- String group = url.getParameter(GROUP_KEY);
- String version = url.getParameter(VERSION_KEY);
- String protocol = url.getProtocol();
- String mappingKey = ServiceNameMapping.buildGroup(serviceInterface,
group, version, protocol);
+ String mappingKey = ServiceNameMapping.buildGroup(serviceInterface);
Set<String> serviceNames = new LinkedHashSet<>();
String registryCluster = getRegistryCluster(url);
MetadataReport metadataReport =
MetadataReportInstance.getMetadataReport(registryCluster);