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 2020/03/07 02:52:35 UTC

[GitHub] [skywalking] arugal commented on a change in pull request #4454: Ignore no upstream real address agent

arugal commented on a change in pull request #4454: Ignore no upstream real address agent
URL: https://github.com/apache/skywalking/pull/4454#discussion_r389221235
 
 

 ##########
 File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInstanceInventoryCache.java
 ##########
 @@ -119,4 +127,22 @@ public int getServiceInstanceId(int serviceId, int addressId) {
         }
         return serviceInstanceId;
     }
+
+    public String getServiceInstanceLanguage(int serviceInstanceId) {
+        String language = languageCache.getIfPresent(serviceInstanceId);
+        if (isNull(language)) {
+            ServiceInstanceInventory inventory = get(serviceInstanceId);
+            if (nonNull(inventory)) {
+                JsonObject properties = inventory.getProperties();
+                for (String key : properties.keySet()) {
+                    if (key.equals(ServiceInstanceInventory.PropertyUtil.LANGUAGE)) {
+                        language = properties.get(key).getAsString().toLowerCase();
+                        languageCache.put(serviceInstanceId, language);
+                        return language;
+                    }
+                }
+            }
+        }
+        return Const.EMPTY_STRING;
+    }
 
 Review comment:
   Done, thanks for your review :laughing:

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services