apache / dubbo-admin
Showing 4 of 28 files from the diff.

@@ -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
    }

@@ -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
}

@@ -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
    }

@@ -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
Files Complexity Coverage
dubbo-admin-server/src/main/java/org/apache/dubbo/admin 18.92% 21.34%
Project Totals (149 files) 18.92% 21.34%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading