You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/12/24 01:50:51 UTC

[GitHub] [druid] FrankChen021 commented on a change in pull request #12096: perf: improve RemoteTaskRunner task assignment loop performance

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



##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/overlord/ZkWorker.java
##########
@@ -63,6 +66,27 @@ public ZkWorker(Worker worker, PathChildrenCache statusCache, final ObjectMapper
     this.statusCache = statusCache;
     this.cacheConverter = (ChildData input) ->
         JacksonUtils.readValue(jsonMapper, input.getData(), TaskAnnouncement.class);
+    this.taskIdExtractor = createTaskIdExtractor(jsonMapper);
+  }
+
+  static java.util.function.Function<ChildData, String> createTaskIdExtractor(final ObjectMapper jsonMapper)
+  {
+    return (ChildData input) -> {
+      try {
+        JsonNode parent = jsonMapper.readTree(input.getData());

Review comment:
       `readTree` still deserializes all the input to object. Since here we just want to get the value of `id` field, I think we can use jackson's streaming parser api to get the id so that we don't need to parse all the string content.




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