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:27:36 UTC
[GitHub] [kafka] tang7526 opened a new pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
tang7526 opened a new pull request #9991:
URL: https://github.com/apache/kafka/pull/9991
- Reorder the modifiers to comply with the Java Language Specification.
- Replace Map.get() and condition with a call to Map.computeIfAbsent().
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
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
[GitHub] [kafka] chia7712 commented on a change in pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [kafka] chia7712 commented on a change in pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #9991:
URL: https://github.com/apache/kafka/pull/9991#discussion_r566241334
##########
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:
my bad. please ignore above comment :(
----------------------------------------------------------------
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
[GitHub] [kafka] chia7712 commented on pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #9991:
URL: https://github.com/apache/kafka/pull/9991#issuecomment-769546117
@tang7526 Could you merge trunk to trigger QA again?
----------------------------------------------------------------
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
[GitHub] [kafka] tang7526 commented on pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
Posted by GitBox <gi...@apache.org>.
tang7526 commented on pull request #9991:
URL: https://github.com/apache/kafka/pull/9991#issuecomment-769547448
> @tang7526 Could you merge trunk to trigger QA again?
Done
----------------------------------------------------------------
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
[GitHub] [kafka] chia7712 merged pull request #9991: MINOR: Reorder the modifiers and Replace Map.get with Map.computeIfAbsent
Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #9991:
URL: https://github.com/apache/kafka/pull/9991
----------------------------------------------------------------
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