apache / dubbo-admin

Compare ee2672c ... +6 ... f179042

Coverage Reach
model/domain/Provider.java model/domain/Override.java model/domain/Route.java model/domain/Consumer.java model/domain/TypeDefinition.java model/domain/Entity.java model/domain/ServiceDefinition.java model/domain/MethodDefinition.java model/domain/MockRule.java model/domain/LoadBalance.java model/domain/Weight.java model/domain/MethodMetadata.java model/domain/Tag.java model/domain/FullServiceDefinition.java model/domain/RegistrySource.java model/store/mesh/virtualservice/match/DubboMethodMatch.java model/store/mesh/virtualservice/match/StringMatch.java model/store/mesh/virtualservice/match/DubboAttachmentMatch.java model/store/mesh/virtualservice/match/DubboMethodArg.java model/store/mesh/virtualservice/match/DoubleMatch.java model/store/mesh/virtualservice/match/DoubleRangeMatch.java model/store/mesh/virtualservice/match/ListStringMatch.java model/store/mesh/virtualservice/match/ListDoubleMatch.java model/store/mesh/virtualservice/match/BoolMatch.java model/store/mesh/virtualservice/match/ListBoolMatch.java model/store/mesh/virtualservice/DubboMatchRequest.java model/store/mesh/virtualservice/destination/DubboDestination.java model/store/mesh/virtualservice/destination/DubboRouteDestination.java model/store/mesh/virtualservice/DubboRoute.java model/store/mesh/virtualservice/DubboRouteDetail.java model/store/mesh/virtualservice/VirtualServiceSpec.java model/store/mesh/virtualservice/VirtualServiceRule.java model/store/mesh/destination/loadbalance/LoadBalancerSettings.java model/store/mesh/destination/loadbalance/SimpleLB.java model/store/mesh/destination/loadbalance/ConsistentHashLB.java model/store/mesh/destination/DestinationRuleSpec.java model/store/mesh/destination/Subset.java model/store/mesh/destination/DestinationRule.java model/store/mesh/destination/TrafficPolicy.java model/store/mesh/destination/ConnectionPoolSettings.java model/store/mesh/destination/TcpKeepalive.java model/store/mesh/destination/TCPSettings.java model/store/mesh/VsDestinationGroup.java model/store/mesh/BaseRule.java model/store/OverrideConfig.java model/store/RoutingRule.java model/store/TagRoute.java model/store/OverrideDTO.java model/dto/RelationDTO.java model/dto/docs/CallDubboServiceRequest.java model/dto/docs/ApiInfoRequest.java model/dto/docs/CallDubboServiceRequestInterfaceParam.java model/dto/ServiceDTO.java model/dto/MetricDTO.java model/dto/MockRuleDTO.java model/dto/ServiceDetailDTO.java model/dto/BaseDTO.java model/dto/ServiceTestDTO.java model/dto/ConfigDTO.java model/dto/RouteDTO.java model/dto/AccessDTO.java model/dto/DynamicConfigDTO.java model/dto/BalancingDTO.java model/dto/WeightDTO.java model/dto/ConditionRouteDTO.java model/dto/MeshRouteDTO.java model/dto/TagRouteDTO.java model/adapter/LoadBalance2OverrideAdapter.java model/adapter/BalancingDTO2OverrideConfigAdapter.java model/adapter/DynamicConfigDTO2OverrideDTOAdapter.java model/adapter/WeightToOverrideAdapter.java service/impl/OverrideServiceImpl.java service/impl/RouteServiceImpl.java service/impl/ProviderServiceImpl.java service/impl/InstanceRegistryQueryHelper.java service/impl/MetricsServiceImpl.java service/impl/MockRuleServiceImpl.java service/impl/GenericServiceImpl.java service/impl/MeshRouteServiceImpl.java service/impl/InstanceRegistryCache.java service/impl/ConsumerServiceImpl.java service/impl/ManagementServiceImpl.java service/impl/MetrcisCollectServiceImpl.java service/impl/InterfaceRegistryCache.java service/impl/AbstractService.java service/RegistryServerSync.java service/RegistryCache.java common/util/RouteUtils.java common/util/ParseUtils.java common/util/ServiceTestV3Util.java common/util/SyncUtils.java common/util/ServiceTestUtil.java common/util/OverrideUtils.java common/util/ConvertUtil.java common/util/Pair.java common/util/CoderUtil.java common/util/UrlUtils.java common/util/Tool.java common/util/YamlParser.java common/util/Constants.java common/exception/ServiceException.java common/exception/SystemException.java common/exception/ResourceNotFoundException.java common/exception/PermissionDeniedException.java common/exception/ParamValidationException.java common/exception/VersionValidationException.java common/exception/ConfigurationException.java common/CommonResponse.java controller/ApiDocsController.java controller/ServiceController.java controller/TagRoutesController.java controller/MetricsCollectController.java controller/ConditionRoutesController.java controller/OverridesController.java controller/AccessesController.java controller/LoadBalanceController.java controller/WeightController.java controller/ManagementController.java controller/ServiceTestController.java controller/MeshRouteController.java controller/beans/DubboApiDocsParamInfoBean.java controller/UserController.java controller/editors/CustomLocalDateTimeEditor.java controller/editors/CustomLocalDateEditor.java controller/MockRuleController.java registry/mapping/impl/NacosServiceMapping.java registry/mapping/impl/ZookeeperServiceMapping.java registry/mapping/impl/NoOpServiceMapping.java registry/mapping/AdminMappingListener.java registry/mapping/AdminServiceInstancesChangedListener.java registry/metadata/impl/NacosMetaDataCollector.java registry/metadata/impl/RedisMetaDataCollector.java registry/metadata/impl/ZookeeperMetaDataCollector.java registry/metadata/impl/ConsulMetaDataCollector.java registry/metadata/impl/NoOpMetadataCollector.java registry/config/impl/MultiDynamicConfiguration.java registry/config/impl/NoOpConfiguration.java utils/ApiDocsDubboGenericUtil.java utils/JwtTokenUtil.java utils/LocalDateTimeUtil.java utils/SpringBeanUtils.java config/ConfigCenter.java config/SwaggerConfiguration.java config/WebMvcConfiguration.java interceptor/AuthInterceptor.java authentication/impl/DefaultPreHandle.java handler/CustomExceptionHandler.java DubboAdminApplication.java provider/MockServiceProvider.java

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 4 of 46 files from the diff.
Other files ignored by Codecov
NOTICE has changed.
pom.xml has changed.
README.md has changed.
README_ZH.md has changed.
docker/stack.yml has changed.

@@ -45,7 +45,7 @@
Loading
45 45
    private ApiInfo apiInfo() {
46 46
        return new ApiInfoBuilder()
47 47
                .title("dubbo admin swagger api")
48 -
                .description("for more information please visit github page: https://github.com/apache/incubator-dubbo-admin")
48 +
                .description("for more information please visit github page: https://github.com/apache/dubbo-admin")
49 49
                .version("1.0")
50 50
                .build();
51 51
    }

@@ -105,6 +105,7 @@
Loading
105 105
106 106
        if (StringUtils.isNotEmpty(configCenter)) {
107 107
            configCenterUrl = formUrl(configCenter, configCenterGroup, configCenterGroupNameSpace, username, password);
108 +
            logger.info("Admin using config center: " + configCenterUrl);
108 109
            dynamicConfiguration = ExtensionLoader.getExtensionLoader(GovernanceConfiguration.class).getDefaultExtension();
109 110
            dynamicConfiguration.setUrl(configCenterUrl);
110 111
            dynamicConfiguration.init();
@@ -118,6 +119,8 @@
Loading
118 119
                    } else if (s.startsWith(Constants.METADATA_ADDRESS)) {
119 120
                        metadataUrl = formUrl(removerConfigKey(s), metadataGroup, metadataGroupNameSpace, username, password);
120 121
                    }
122 +
                    logger.info("Registry address found from config center: " + registryUrl);
123 +
                    logger.info("Metadata address found from config center: " + registryUrl);
121 124
                });
122 125
            }
123 126
        }
@@ -127,9 +130,9 @@
Loading
127 130
                dynamicConfiguration = ExtensionLoader.getExtensionLoader(GovernanceConfiguration.class).getDefaultExtension();
128 131
                dynamicConfiguration.setUrl(registryUrl);
129 132
                dynamicConfiguration.init();
130 -
                logger.warn("you are using dubbo.registry.address, which is not recommend, please refer to: https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration");
133 +
                logger.warn("you are using dubbo.registry.address, which is not recommend, please refer to: https://github.com/apache/dubbo-admin/wiki/Dubbo-Admin-configuration");
131 134
            } else {
132 -
                throw new ConfigurationException("Either config center or registry address is needed, please refer to https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration");
135 +
                throw new ConfigurationException("Either config center or registry address is needed, please refer to https://github.com/apache/dubbo-admin/wiki/Dubbo-Admin-configuration");
133 136
                //throw exception
134 137
            }
135 138
        }
@@ -145,10 +148,13 @@
Loading
145 148
        Registry registry = null;
146 149
        if (registryUrl == null) {
147 150
            if (StringUtils.isBlank(registryAddress)) {
148 -
                throw new ConfigurationException("Either config center or registry address is needed, please refer to https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration");
151 +
                throw new ConfigurationException("Either config center or registry address is needed, please refer to https://github.com/apache/dubbo-admin/wiki/Dubbo-Admin-configuration");
149 152
            }
150 153
            registryUrl = formUrl(registryAddress, registryGroup, registryNameSpace, username, password);
151 154
        }
155 +
156 +
        logger.info("Admin using registry address: " + registryUrl);
157 +
152 158
        RegistryFactory registryFactory = ApplicationModel.defaultModel().getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
153 159
        registry = registryFactory.getRegistry(registryUrl.addParameter(ENABLE_EMPTY_PROTECTION_KEY, String.valueOf(false)));
154 160
        return registry;
@@ -166,13 +172,14 @@
Loading
166 172
                metadataUrl = formUrl(metadataAddress, metadataGroup, metadataGroupNameSpace, username, password);
167 173
                metadataUrl = metadataUrl.addParameter(CLUSTER_KEY, cluster);
168 174
            }
175 +
            logger.info("Admin using metadata address: " + metadataUrl);
169 176
        }
170 177
        if (metadataUrl != null) {
171 178
            metaDataCollector = ApplicationModel.defaultModel().getExtensionLoader(MetaDataCollector.class).getExtension(metadataUrl.getProtocol());
172 179
            metaDataCollector.setUrl(metadataUrl);
173 180
            metaDataCollector.init();
174 181
        } else {
175 -
            logger.warn("you are using dubbo.registry.address, which is not recommend, please refer to: https://github.com/apache/incubator-dubbo-admin/wiki/Dubbo-Admin-configuration");
182 +
            logger.warn("you are using dubbo.registry.address, which is not recommend, please refer to: https://github.com/apache/dubbo-admin/wiki/Dubbo-Admin-configuration");
176 183
        }
177 184
        return metaDataCollector;
178 185
    }

@@ -97,7 +97,7 @@
Loading
97 97
        origin.keySet().forEach(providers::remove);
98 98
99 99
        for (List<InstanceAddressURL> instanceAddressURLs : providers.values()) {
100 -
            MetadataService metadataService = MetadataUtils.referProxy(instanceAddressURLs.get(0).getInstance());
100 +
            MetadataService metadataService = MetadataUtils.referProxy(instanceAddressURLs.get(0).getInstance()).getProxy();
101 101
            try {
102 102
                Set<String> subscribedURLs = metadataService.getSubscribedURLs();
103 103

@@ -26,12 +26,13 @@
Loading
26 26
import java.util.List;
27 27
import java.util.Map;
28 28
import java.util.Set;
29 +
import java.util.stream.Collectors;
29 30
30 31
public class AdminServiceInstancesChangedListener extends ServiceInstancesChangedListener {
31 32
32 33
    private AddressChangeListener addressChangeListener;
33 34
34 -
    private Map<String, Object> oldServiceUrls;
35 +
    private Map<String, List<ServiceInstancesChangedListener.ProtocolServiceKeyWithUrls>> oldServiceUrls;
35 36
36 37
    public AdminServiceInstancesChangedListener(Set<String> serviceNames, ServiceDiscovery serviceDiscovery, AddressChangeListener addressChangeListener) {
37 38
        super(serviceNames, serviceDiscovery);
@@ -43,8 +44,14 @@
Loading
43 44
        oldServiceUrls.keySet().stream()
44 45
                .filter(protocolServiceKey -> !serviceUrls.containsKey(protocolServiceKey))
45 46
                .forEach(protocolServiceKey -> addressChangeListener.notifyAddressChanged(protocolServiceKey, new ArrayList<>()));
46 -
        serviceUrls.forEach((protocolServiceKey, urls) -> addressChangeListener.notifyAddressChanged(protocolServiceKey, (List<URL>) urls));
47 +
        serviceUrls.forEach((protocolServiceKey, urls) -> addressChangeListener.notifyAddressChanged(protocolServiceKey, extractUrls(urls)));
47 48
48 49
        oldServiceUrls = serviceUrls;
49 50
    }
51 +
52 +
    private List<URL> extractUrls(List<ServiceInstancesChangedListener.ProtocolServiceKeyWithUrls> keyUrls) {
53 +
        return keyUrls.stream()
54 +
                .flatMap((protocolServiceKeyWithUrls) -> protocolServiceKeyWithUrls.getUrls().stream())
55 +
                .collect(Collectors.toList());
56 +
    }
50 57
}

Learn more Showing 5 files with coverage changes found.

Changes in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/service/RegistryServerSync.java
-2
-1
+3
Loading file...
Changes in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/controller/MetricsCollectController.java
+1
Loading file...
Changes in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/common/util/RouteUtils.java
+1
Loading file...
Changes in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/AdminMappingListener.java
New
Loading file...
Changes in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/registry/mapping/impl/ZookeeperServiceMapping.java
-3
+3
Loading file...
Files Complexity Coverage
dubbo-admin-server/src/main/java/org/apache/dubbo/admin +5.00% 18.88% 0.14% 21.30%
Project Totals (149 files) 18.88% 21.30%
Loading