yannxia commented on a change in pull request #2148: Support service inventory 
extension fields in json format
URL: 
https://github.com/apache/incubator-skywalking/pull/2148#discussion_r247190370
 
 

 ##########
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java
 ##########
 @@ -86,6 +90,24 @@ public void setServiceNodeType(NodeType nodeType) {
         return result;
     }
 
+    public void setProperties(JsonObject properties) {
+        this.properties = properties;
+        if (properties != null && properties.keySet().size() > 0) {
+            this.prop = properties.toString();
+        }
+    }
+
+    private void setProp(String prop) {
+        this.prop = prop;
+        if (!Strings.isNullOrEmpty(prop)) {
+            this.properties = new Gson().fromJson(prop, JsonObject.class);
 
 Review comment:
   not necessary `new Gson()`  everytime. maybe  member variable

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to