Compare
0f255b0
... +0 ...
cc5e780
0f255b0
... +0 ...
cc5e780
Showing 1 of 1 files from the diff.
@@ -28,6 +28,7 @@
Loading
28 | 28 | import org.apache.dubbo.common.utils.StringUtils; |
|
29 | 29 | import org.apache.dubbo.registry.NotifyListener; |
|
30 | 30 | import org.apache.dubbo.registry.Registry; |
|
31 | + | ||
31 | 32 | import org.springframework.beans.factory.DisposableBean; |
|
32 | 33 | import org.springframework.beans.factory.annotation.Autowired; |
|
33 | 34 | import org.springframework.boot.context.event.ApplicationReadyEvent; |
@@ -41,7 +42,6 @@
Loading
41 | 42 | import java.util.Set; |
|
42 | 43 | import java.util.concurrent.ConcurrentHashMap; |
|
43 | 44 | import java.util.concurrent.ConcurrentMap; |
|
44 | - | import java.util.concurrent.atomic.AtomicLong; |
|
45 | 45 | ||
46 | 46 | @Component |
|
47 | 47 | public class RegistryServerSync implements DisposableBean, NotifyListener { |
@@ -60,8 +60,6 @@
Loading
60 | 60 | Constants.ENABLED_KEY, Constants.ANY_VALUE, |
|
61 | 61 | Constants.CHECK_KEY, String.valueOf(false)); |
|
62 | 62 | ||
63 | - | private static final AtomicLong ID = new AtomicLong(); |
|
64 | - | ||
65 | 63 | /** |
|
66 | 64 | * Make sure ID never changed when the same url notified many times |
|
67 | 65 | */ |
@@ -88,7 +86,7 @@
Loading
88 | 86 | registry.unsubscribe(SUBSCRIBE, this); |
|
89 | 87 | } |
|
90 | 88 | ||
91 | - | // Notification of of any service with any type (override、subcribe、route、provider) is full. |
|
89 | + | // Notification of any service with any type (override、subscribe、route、provider) is full. |
|
92 | 90 | @Override |
|
93 | 91 | public void notify(List<URL> urls) { |
|
94 | 92 | if (urls == null || urls.isEmpty()) { |
@@ -157,12 +155,12 @@
Loading
157 | 155 | String category = categoryEntry.getKey(); |
|
158 | 156 | ConcurrentMap<String, Map<String, URL>> services = interfaceRegistryCache.get(category); |
|
159 | 157 | if (services == null) { |
|
160 | - | services = new ConcurrentHashMap<String, Map<String, URL>>(); |
|
158 | + | services = new ConcurrentHashMap<>(); |
|
161 | 159 | interfaceRegistryCache.put(category, services); |
|
162 | 160 | } else {// Fix map can not be cleared when service is unregistered: when a unique “group/service:version” service is unregistered, but we still have the same services with different version or group, so empty protocols can not be invoked. |
|
163 | - | Set<String> keys = new HashSet<String>(services.keySet()); |
|
161 | + | Set<String> keys = new HashSet<>(services.keySet()); |
|
164 | 162 | for (String key : keys) { |
|
165 | - | if (Tool.getInterface(key).equals(interfaceName) && !categoryEntry.getValue().entrySet().contains(key)) { |
|
163 | + | if (Tool.getInterface(key).equals(interfaceName) && !categoryEntry.getValue().containsKey(key)) { |
|
166 | 164 | services.remove(key); |
|
167 | 165 | } |
|
168 | 166 | } |
2 Commits
Files | Complexity | Coverage |
---|---|---|
dubbo-admin-server/src/main/java/org/apache/dubbo/admin | 18.69% | -0.02% 20.80% |
Project Totals (144 files) | 18.69% | 20.80% |
cc5e780
0f255b0