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/08/05 02:11:28 UTC

[skywalking] branch component-bug created (now 934f4f9)

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

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


      at 934f4f9  Use client side component name when no server side mapping.

This branch includes the following new commits:

     new 934f4f9  Use client side component name when no server side mapping.

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: Use client side component name when no server side mapping.

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

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

commit 934f4f9458dabd2cf449f6edbcc49ded35dc51f7
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Wed Aug 5 10:11:13 2020 +0800

    Use client side component name when no server side mapping.
---
 .../oap/server/core/config/ComponentLibraryCatalogService.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java
index 88ba448..731da18 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java
@@ -22,7 +22,6 @@ import java.io.FileNotFoundException;
 import java.io.Reader;
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.library.util.ResourceUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,7 +64,7 @@ public class ComponentLibraryCatalogService implements IComponentLibraryCatalogS
     @Override
     public String getServerNameBasedOnComponent(int componentId) {
         Integer serverComponentId = componentId2ServerId.get(componentId);
-        return serverComponentId == null ? Const.UNKNOWN : getComponentName(serverComponentId);
+        return serverComponentId == null ? getComponentName(componentId) : getComponentName(serverComponentId);
     }
 
     private void init() throws InitialComponentCatalogException {
@@ -96,10 +95,12 @@ public class ComponentLibraryCatalogService implements IComponentLibraryCatalogS
 
             nameMapping.forEach((name, serverName) -> {
                 if (!componentName2Id.containsKey(name)) {
-                    throw new InitialComponentCatalogException("Component name [" + name + "] in Component-Server-Mappings doesn't exist in component define. ");
+                    throw new InitialComponentCatalogException(
+                        "Component name [" + name + "] in Component-Server-Mappings doesn't exist in component define. ");
                 }
                 if (!componentName2Id.containsKey(serverName)) {
-                    throw new InitialComponentCatalogException("Server componentId name [" + serverName + "] in Component-Server-Mappings doesn't exist in component define. ");
+                    throw new InitialComponentCatalogException(
+                        "Server componentId name [" + serverName + "] in Component-Server-Mappings doesn't exist in component define. ");
                 }
 
                 componentId2ServerId.put(componentName2Id.get(name), componentName2Id.get(serverName));