KAFKA-8736: Streams performance improvement, use isEmpty() rather tha…#7164
KAFKA-8736: Streams performance improvement, use isEmpty() rather tha…#7164mjsax merged 1 commit intoapache:trunkfrom
Conversation
|
Thanks for the PR! LGTM. I think this should be cherry-picked back to 2.3 cc/ @bbejeck @mjsax @guozhangwang |
mjsax
left a comment
There was a problem hiding this comment.
LGTM.
Waiting for Jenkins to finish before we can merge.
guozhangwang
left a comment
There was a problem hiding this comment.
Thanks @mjarvie ! LGTM.
|
Java 11 / 2.12 failed with Retest this please |
|
Java 11 / 2.12: Merging. Thanks for the PR @mjarvie |
…n size() == 0 (#7164) Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
…n size() == 0 (#7164) Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
…n size() == 0 (#7164) Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
…n size() == 0 (#7164) Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io>
|
Merged to |
The avro upgrade was needed to fix the following error during ':support-metrics-client:generateAvro': Caused by: org.apache.velocity.exception.MethodInvocationException: Variable $velocityCount has not been set at /org/apache/avro/compiler/specific/templates/java/classic/record.vm[line 82, column 150] Conflicts: * gradle.properties -> trivial fix, `scalaVersion` is next to `version`, which is different in ccs kafka * gradle/dependencies.gradle -> reduce divergence with apache kafka by using `httpclient` instead of `httpcomponents` from the `versions` array. Remove unused `httpmime` and `httpcomponents` from said array. * apache-github/trunk: MINOR: Update dependencies for Kafka 2.4 (apache#7126) KAFKA-8599: Use automatic RPC generation in ExpireDelegationToken MINOR: Upgrade jackson-databind to 2.9.9.3 (apache#7125) MINOR: some small style fixes to RoundRobinPartitioner KAFKA-8736: Streams performance improvement, use isEmpty() rather than size() == 0 (apache#7164) Minor: Refactor methods to add metrics to sensor in `StreamsMetricsImpl` (apache#7161)
…t, use isEmpty() rather than size() == 0 (apache#7164) TICKET = KAFKA-8736 LI_DESCRIPTION = EXIT_CRITERIA = HASH [0826d6e] ORIGINAL_DESCRIPTION = Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <guozhang@confluent.io> (cherry picked from commit 0826d6e)
…n size() == 0
According to https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#size--, the size method has to traverse all elements to get a count. It looks like the count is being compared against 0 to determine if the map is empty; In this case, we don't need a full count. Instead, the isEmpty() method should be used, which just looks for one node.
No expected changes to unit or integration tests.
Committer Checklist (excluded from commit message)