kfaraz commented on code in PR #18547:
URL: https://github.com/apache/druid/pull/18547#discussion_r2367993780


##########
server/src/main/java/org/apache/druid/server/DruidNode.java:
##########
@@ -89,6 +90,9 @@ public class DruidNode
       "unknown"
   );
 
+  @JsonProperty
+  private Map<String, String> labels = new HashMap<>();

Review Comment:
   +1, the default should just be null.



##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java:
##########
@@ -687,18 +704,24 @@ private static Object[] buildRowForDiscoverableDataServer(
       } else {
         currentSize = serverFromInventoryView.getCurrSize();
       }
-      return new Object[]{
-          node.getHostAndPortToUse(),
-          node.getHost(),
-          (long) node.getPlaintextPort(),
-          (long) node.getTlsPort(),
-          StringUtils.toLowerCase(discoveryDruidNode.getNodeRole().toString()),
-          druidServerToUse.getTier(),
-          currentSize,
-          druidServerToUse.getMaxSize(),
-          null,
-          toStringOrNull(discoveryDruidNode.getStartTime())
-      };
+      try {
+        return new Object[]{
+            node.getHostAndPortToUse(),
+            node.getHost(),
+            (long) node.getPlaintextPort(),
+            (long) node.getTlsPort(),
+            
StringUtils.toLowerCase(discoveryDruidNode.getNodeRole().toString()),
+            druidServerToUse.getTier(),
+            currentSize,
+            druidServerToUse.getMaxSize(),
+            null,
+            toStringOrNull(discoveryDruidNode.getStartTime()),
+            node.getLabels() == null ? null : 
jsonMapper.writeValueAsString(node.getLabels())

Review Comment:
   This method returns an `Object[]` which can contain a map, why do we need to 
serialize the labels using a `jsonMapper` at all?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to