You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "imply-cheddar (via GitHub)" <gi...@apache.org> on 2023/03/14 09:13:36 UTC

[GitHub] [druid] imply-cheddar commented on a diff in pull request #13930: add null safety checks for DiscoveryDruidNode services for more resilient http server and task views

imply-cheddar commented on code in PR #13930:
URL: https://github.com/apache/druid/pull/13930#discussion_r1135222992


##########
server/src/main/java/org/apache/druid/discovery/DiscoveryDruidNode.java:
##########
@@ -164,6 +166,13 @@ public DruidNode getDruidNode()
     return druidNode;
   }
 
+  @Nullable
+  @JsonIgnore
+  public <T extends DruidService> T getService(String key)
+  {
+    return (T) services.get(key);
+  }
+

Review Comment:
   What are the chances that there's a ClassCastException thrown here?  Should we try to be defensive?



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org