[MINOR] In-memory stores cleanup#6595
Conversation
|
Call for review @cadonna @bbejeck @mjsax @vvcephei @guozhangwang |
|
|
||
| public void close() { | ||
| openIterators.remove(this); | ||
| callback.deregisterIterator(this); |
There was a problem hiding this comment.
If the object is created with the no-argument constructor, this will throw an NPE.
There was a problem hiding this comment.
What's the benefits of using a callback here than calling openIterators directly? I think adding to openIterators outside of the constructor makes sense, but cannot think of the rationale of doing this upon closure.
There was a problem hiding this comment.
I felt it was appropriate to make the iterator class(es) static, in which case we need a way to remove from openIterators on closure. Will fix NPE when I add emptyIterator() method
There was a problem hiding this comment.
Ack, thanks for the explanation.
|
|
||
| public void close() { | ||
| openIterators.remove(this); | ||
| callback.deregisterIterator(this); |
There was a problem hiding this comment.
What's the benefits of using a callback here than calling openIterators directly? I think adding to openIterators outside of the constructor makes sense, but cannot think of the rationale of doing this upon closure.
Other that that, this PR LGTM. |
|
Ack, fixed checkstyle. Waiting for tests to pass |
cadonna
left a comment
There was a problem hiding this comment.
LGTM
Thank you @ableegoldman!
|
Java 8 passed, Java 11 failed with retest this please |
|
Jaba 8 passed, Java 11 failed with test results no longer available retest this, please |
|
Java 11 passed, Java 8 failed on kafka.api.PlaintextConsumerTest.testAsyncCommit retest this, please |
|
Thanks @ableegoldman ! |
* ak/trunk: (42 commits) KAFKA-8134: `linger.ms` must be a long KAFKA-7779; Avoid unnecessary loop iteration in leastLoadedNode (apache#6081) MINOR: Update Gradle to 5.4.1 and update its plugins (apache#6436) MINOR: improve Session expiration notice (apache#6618) KAFKA-8029: In memory session store (apache#6525) MINOR: In-memory stores cleanup (apache#6595) KAFKA-7862 & KIP-345 part-one: Add static membership logic to JoinGroup protocol (apache#6177) KAFKA-8254: Pass Changelog as Topic in Suppress Serdes (apache#6602) KAFKA-7903: automatically generate OffsetCommitRequest (apache#6583) KAFKA-8291 : System test fix (apache#6637) MINOR: Do not log retriable offset commit exceptions as errors (apache#5904) MINOR: Fix log message error of loadTransactionMetadata (apache#6571) MINOR: Fix 404 security features links (apache#6634) MINOR: Remove an unnecessary character from broker's startup log MINOR: Make LogCleaner.shouldRetainRecord more readable (apache#6590) MINOR: Remove implicit return statement (apache#6629) KAFKA-8237; Untangle TopicDeleteManager and add test cases (apache#6588) KAFKA-8227 DOCS Fixed missing links duality of streams tables (apache#6625) MINOR: reformat settings.gradle to be more readable (apache#6621) MINOR: Correct RestServerTest formatting ... Conflicts: build.gradle settings.gradle
While going through the review of InMemorySessionStore I realized there is also some minor cleanup to be done for the other in-memory stores. This includes trivial changes such as removing unnecessary references to 'this' and moving collection initialization to the declaration. It also fixes some unsafe behavior (registering an iterator from inside its own constructor). In-memory window store iterator classes were made static and some instances of KeyValueIterator missing types were fixed across a handful of tests. Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bruno Cadonna <bruno@confluent.io>
While going through the review of InMemorySessionStore I realized there is also some minor cleanup to be done for the other in-memory stores. This includes trivial changes such as removing unnecessary references to 'this' and moving collection initialization to the declaration. It also fixes some unsafe behavior (registering an iterator from inside its own constructor). In-memory window store iterator classes were made static and some instances of KeyValueIterator missing types were fixed across a handful of tests
Committer Checklist (excluded from commit message)