You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/01/01 14:37:12 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #8367: Support OAP server v9 Core concept: Layer, backend side

wu-sheng commented on a change in pull request #8367:
URL: https://github.com/apache/skywalking/pull/8367#discussion_r777113668



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
##########
@@ -117,4 +97,19 @@ public EndpointInfo getEndpointInfo(final String endpointId) throws IOException
         endpointInfo.setServiceName(serviceIDDefinition.getName());
         return endpointInfo;
     }
+
+    private List<Service> combineServices(List<Service> services) {
+        return new ArrayList<>(services.stream()
+                                                    .peek(service -> {
+                                                        if (service.getGroup() == null) {
+                                                            service.setGroup(Const.EMPTY_STRING);
+                                                        }
+                                                    })
+                                                    .collect(Collectors.toMap(Service::getName, service -> service,
+                                                                              (s1, s2) -> {
+                                                                                  s1.getLayers().addAll(s2.getLayers());
+                                                                                  return s1;
+                                                                              }
+                                                    )).values());

Review comment:
       ```suggestion
           return new ArrayList<>(
               services.stream()
                       .peek(service -> {
                           if (service.getGroup() == null) {
                               service.setGroup(Const.EMPTY_STRING);
                           }
                       })
                       .collect(
                           Collectors.toMap(Service::getName, service -> service,
                                            (s1, s2) -> {
                                                s1.getLayers().addAll(s2.getLayers());
                                                return s1;
                                            }
                           )).values());
       };
   ```
   
   This format seems more readable, although the current one could pass the style check.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org