lianetm commented on code in PR #16083:
URL: https://github.com/apache/kafka/pull/16083#discussion_r1616077491


##########
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceListener.java:
##########
@@ -28,37 +28,37 @@
  * This is applicable when the consumer is having Kafka auto-manage group 
membership. If the consumer directly assigns partitions,
  * those partitions will never be reassigned and this callback is not 
applicable.
  * <p>
- * When Kafka is managing the group membership, a partition re-assignment will 
be triggered any time the members of the group change or the subscription
+ * When Kafka is managing the group membership, a partition re-assignment will 
be triggered whenever the members of the group change or the subscription
  * of the members changes. This can occur when processes die, new process 
instances are added or old instances come back to life after failure.
- * Partition re-assignments can also be triggered by changes affecting the 
subscribed topics (e.g. when the number of partitions is
+ * Partition re-assignments can also be triggered by changing the subscribed 
topics (e.g. when the number of partitions is
  * administratively adjusted).
  * <p>
  * There are many uses for this functionality. One common use is saving 
offsets in a custom store. By saving offsets in
  * the {@link #onPartitionsRevoked(Collection)} call we can ensure that any 
time partition assignment changes
  * the offset gets saved.
  * <p>
  * Another use is flushing out any kind of cache of intermediate results the 
consumer may be keeping. For example,
- * consider a case where the consumer is subscribed to a topic containing user 
page views, and the goal is to count the
- * number of page views per user for each five minute window. Let's say the 
topic is partitioned by the user id so that
+ * consider a case where the consumer is subscribing to a topic containing 
user page views, and the goal is to count the
+ * number of page views per user for each five minutes window. Let's say the 
topic is partitioned by the user id so that
  * all events for a particular user go to a single consumer instance. The 
consumer can keep in memory a running
- * tally of actions per user and only flush these out to a remote data store 
when its cache gets too big. However if a
- * partition is reassigned it may want to automatically trigger a flush of 
this cache, before the new owner takes over
+ * tally of actions per user and only flush these out to a remote data store 
when its cache gets too big. However, if a
+ * partition is reassigned, it may want to automatically trigger a flush of 
this cache, before the new owner takes over
  * consumption.
  * <p>
  * This callback will only execute in the user thread as part of the {@link 
Consumer#poll(java.time.Duration) poll(long)} call
  * whenever partition assignment changes.
  * <p>
  * Under normal conditions, if a partition is reassigned from one consumer to 
another, then the old consumer will
  * always invoke {@link #onPartitionsRevoked(Collection) onPartitionsRevoked} 
for that partition prior to the new consumer
- * invoking {@link #onPartitionsAssigned(Collection) onPartitionsAssigned} for 
the same partition. So if offsets or other state is saved in the
- * {@link #onPartitionsRevoked(Collection) onPartitionsRevoked} call by one 
consumer member, it will be always accessible by the time the
+ * invoking {@link #onPartitionsAssigned(Collection) onPartitionsAssigned} for 
the same partition. So if offsets or other states are saved in the
+ * {@link #onPartitionsRevoked(Collection) onPartitionsRevoked} call by one 
consumer member, it will be always accessible by the time, the

Review Comment:
   This added `times,` seems to be splitting the sentence at the wrong place I 
would say, and we still don't have the idea right as I see it. What about:
   ```suggestion
    * {@link #onPartitionsRevoked(Collection) onPartitionsRevoked} call by one 
consumer member, it will be always accessible by the time the other consumer 
taking over that partition **gets a call to** its {@link 
#onPartitionsAssigned(Collection) onPartitionsAssigned} callback to load the 
state.
   ```
   



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to