apache / dubbo-admin

@@ -40,6 +40,7 @@
Loading
40 40
import java.util.concurrent.Executors;
41 41
import java.util.concurrent.ScheduledExecutorService;
42 42
import java.util.concurrent.TimeUnit;
43 +
import java.util.stream.Collectors;
43 44
44 45
import static com.alibaba.nacos.api.PropertyKeyConst.NAMING_LOAD_CACHE_AT_START;
45 46
import static org.apache.dubbo.common.constants.RegistryConstants.CONFIGURATORS_CATEGORY;
@@ -95,7 +96,7 @@
Loading
95 96
    public void listenerAll() {
96 97
97 98
        try {
98 -
            anyServices = getAllServiceNames();
99 +
            anyServices = getAllServiceNames().stream().filter(this::filterApplication).collect(Collectors.toSet());
99 100
        } catch (Exception e) {
100 101
            LOGGER.error("Get nacos all services fail ", e);
101 102
        }
@@ -106,7 +107,7 @@
Loading
106 107
            try {
107 108
                Set<String> serviceNames = getAllServiceNames();
108 109
                for (String serviceName : serviceNames) {
109 -
                    if (anyServices.add(serviceName)) {
110 +
                    if (filterApplication(serviceName) && anyServices.add(serviceName)) {
110 111
                        notifyMappingChangedEvent(serviceName);
111 112
                    }
112 113
                }
@@ -145,16 +146,20 @@
Loading
145 146
        return serviceNames;
146 147
    }
147 148
148 -
    private void notifyMappingChangedEvent(String service) {
149 -
        if (StringUtils.isBlank(service)) {
150 -
            return;
149 +
    private boolean filterApplication(String serviceName) {
150 +
        if (StringUtils.isBlank(serviceName)) {
151 +
            return false;
151 152
        }
152 153
        for (String category : ALL_SUPPORTED_CATEGORIES) {
153 154
            String prefix = category + SERVICE_NAME_SEPARATOR;
154 -
            if (service.startsWith(prefix)) {
155 -
                return;
155 +
            if (serviceName.startsWith(prefix)) {
156 +
                return false;
156 157
            }
157 158
        }
159 +
        return true;
160 +
    }
161 +
162 +
    private void notifyMappingChangedEvent(String service) {
158 163
        MappingChangedEvent event = new MappingChangedEvent(null, Sets.newHashSet(service));
159 164
        for (MappingListener listener : listeners) {
160 165
            listener.onEvent(event);
Files Complexity Coverage
dubbo-admin-server/src/main/java/org/apache/dubbo/admin 18.69% 20.81%
Project Totals (144 files) 18.69% 20.81%

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