|
@@ -109,12 +109,17 @@ public class NotificationControllerV2 implements ReleaseMessageListener {
|
|
|
if (CollectionUtils.isEmpty(notifications)) {
|
|
|
throw new BadRequestException("Invalid format of notifications: " + notificationsAsString);
|
|
|
}
|
|
|
-
|
|
|
- DeferredResultWrapper deferredResultWrapper = new DeferredResultWrapper(bizConfig.longPollingTimeoutInMilli());
|
|
|
- Set<String> namespaces = Sets.newHashSet();
|
|
|
- Map<String, Long> clientSideNotifications = Maps.newHashMap();
|
|
|
+
|
|
|
Map<String, ApolloConfigNotification> filteredNotifications = filterNotifications(appId, notifications);
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(filteredNotifications)) {
|
|
|
+ throw new BadRequestException("Invalid format of notifications: " + notificationsAsString);
|
|
|
+ }
|
|
|
+
|
|
|
+ DeferredResultWrapper deferredResultWrapper = new DeferredResultWrapper(bizConfig.longPollingTimeoutInMilli());
|
|
|
+ Set<String> namespaces = Sets.newHashSetWithExpectedSize(filteredNotifications.size());
|
|
|
+ Map<String, Long> clientSideNotifications = Maps.newHashMapWithExpectedSize(filteredNotifications.size());
|
|
|
+
|
|
|
for (Map.Entry<String, ApolloConfigNotification> notificationEntry : filteredNotifications.entrySet()) {
|
|
|
String normalizedNamespace = notificationEntry.getKey();
|
|
|
ApolloConfigNotification notification = notificationEntry.getValue();
|
|
@@ -125,10 +130,6 @@ public class NotificationControllerV2 implements ReleaseMessageListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (CollectionUtils.isEmpty(namespaces)) {
|
|
|
- throw new BadRequestException("Invalid format of notifications: " + notificationsAsString);
|
|
|
- }
|
|
|
-
|
|
|
Multimap<String, String> watchedKeysMap =
|
|
|
watchKeysUtil.assembleAllWatchKeys(appId, cluster, namespaces, dataCenter);
|
|
|
|