You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/28 16:32:25 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent

chia7712 commented on a change in pull request #9991:
URL: https://github.com/apache/kafka/pull/9991#discussion_r566234009



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java
##########
@@ -644,11 +644,7 @@ private UnsentRequests() {
         public void put(Node node, ClientRequest request) {
             // the lock protects the put from a concurrent removal of the queue for the node
             synchronized (unsent) {
-                ConcurrentLinkedQueue<ClientRequest> requests = unsent.get(node);
-                if (requests == null) {
-                    requests = new ConcurrentLinkedQueue<>();
-                    unsent.put(node, requests);

Review comment:
       You have to call ```put(node, requests)```




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

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