FrankChen021 commented on a change in pull request #12096:
URL: https://github.com/apache/druid/pull/12096#discussion_r774930619



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/overlord/ZkWorker.java
##########
@@ -73,19 +74,18 @@ public ZkWorker(Worker worker, PathChildrenCache 
statusCache, final ObjectMapper
   {
     return (ChildData input) -> {
       try {
-        JsonNode parent = jsonMapper.readTree(input.getData());
-        if (parent != null) {
-          JsonNode id = parent.get(TaskAnnouncement.TASK_ID_KEY);
-          if (id != null) {
-            return id.asText();
+        JsonParser parser = 
jsonMapper.getFactory().createParser(input.getData());

Review comment:
       Use try-with-resources statement to ensure parser is closed.
   
   try (JsonParser parser = 
jsonMapper.getFactory().createParser(input.getData())) {
   




-- 
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