You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/12/10 06:47:55 UTC

[skywalking] branch group-name-query created (now 4d302e6)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch group-name-query
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 4d302e6  Fix group name can't be queried when it is null.

This branch includes the following new commits:

     new 4d302e6  Fix group name can't be queried when it is null.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Fix group name can't be queried when it is null.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch group-name-query
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 4d302e6fb9092a0238aff0e352827fd734c09089
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Dec 10 14:45:05 2020 +0800

    Fix group name can't be queried when it is null.
---
 CHANGES.md                                                     |  3 ++-
 .../skywalking/oap/server/core/query/MetadataQueryService.java | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index a06f660..b38bac2 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -18,7 +18,8 @@ Release Notes.
 * Support influxDB connection response format option. Fix some error when use JSON as influxDB response format.
 * Support Kafka MirrorMaker 2.0 to replicate topics between Kafka clusters.
 * Add the rule name field to alarm record storage entity as a part of ID, to support multiple alarm rules triggered for one entity. The scope id has been removed from the ID.
-* Fix MAL concurrent execution issues
+* Fix MAL concurrent execution issues.
+* Fix group name can't be query in the GraphQL.
 
 #### UI
 * Fix un-removed tags in trace query.
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
index 696dcb1..a5f1e8b 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
@@ -20,6 +20,8 @@ package org.apache.skywalking.oap.server.core.query;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.analysis.IDManager;
 import org.apache.skywalking.oap.server.core.query.type.Database;
 import org.apache.skywalking.oap.server.core.query.type.Endpoint;
@@ -47,7 +49,13 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
     }
 
     public List<Service> getAllServices(final String group) throws IOException {
-        return getMetadataQueryDAO().getAllServices(group);
+        return getMetadataQueryDAO().getAllServices(group).stream()
+                                    .map(service -> {
+                                        if (service.getGroup() == null) {
+                                            service.setGroup(Const.EMPTY_STRING);
+                                        }
+                                        return service;
+                                    }).collect(Collectors.toList());
     }
 
     public List<Service> getAllBrowserServices() throws IOException {