Repository navigation
Conversation
WorkerSinkTask's HandleRebalance becomes a RebalanceListener, registered via setRebalanceListener. Tests capture the listener from setRebalanceListener rather than from subscribe. Callback bodies keep using the enclosing consumer field.
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
|
@adikou Thanks for the PR. |
0a94faf to
8d2416a
Compare
| private class HandleRebalance implements RebalanceListener { | ||
| @Override | ||
| public void onPartitionsAssigned(Collection<TopicPartition> partitions) { | ||
| public void onPartitionsAssigned(Collection<TopicPartition> partitions, RebalanceConsumer rebalanceConsumer) { |
There was a problem hiding this comment.
rebalanceConsumer argument is unused here and in below overridden methods. Is it deliberate?
There was a problem hiding this comment.
I would say so. If we had Java 22, I think it would be appropriate to use the _ for an unused argument.
|
|
||
| doAnswer((Answer<ConsumerRecords<byte[], byte[]>>) invocation -> { | ||
| rebalanceListener.getValue().onPartitionsRevoked(INITIAL_ASSIGNMENT); | ||
| rebalanceListener.getValue().onPartitionsRevoked(INITIAL_ASSIGNMENT, null); |
There was a problem hiding this comment.
Do you see any implications of passing null here, and all the below calls ?
As at this moment, that argument is ignored. But later when it's implemented, probably this needs a change.
|
@adikou Would you please rebase code? |
WorkerSinkTask's HandleRebalance becomes a RebalanceListener, registered
via setRebalanceListener. Tests capture the listener from
setRebalanceListener rather than from subscribe. Callback bodies keep
using the enclosing consumer field.
Reviewers: Andrew Schofield aschofield@confluent.io, Chia-Ping Tsai chia7712@gmail.com