KAFKA-19284 Add documentation to clarify the behavior of null values for all partitionsToOffsetAndMetadata methods. (#19728)
CI / build (push) Waiting to run Details

Adds missing documentation to the `partitionsToOffsetAndMetadata`
methods in both `ListStreamsGroupOffsetsResult` and
`ListShareGroupOffsetsResult` classes to clarify the behavior when a
group does not have a committed offset for a specific partition.

As document in ListConsumerGroupOffsetsResult: > If the group doesn’t
have a committed offset for a specific partition, the corresponding
value in the returned map will be null.

This important detail was previously missing in the JavaDoc of the
stream and share group variants.

Reviewers: Nick Guo <lansg0504@gmail.com>, Chia-Ping Tsai
 <chia7712@gmail.com>
This commit is contained in:
Logan Zhu 2025-06-01 02:17:47 +08:00 committed by GitHub
parent f9df9b5652
commit 4eac6adf91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -66,10 +66,8 @@ public class ListShareGroupOffsetsResult {
} }
/** /**
* Return a future which yields a map of topic partitions to offsets for the specified group. * Return a future which yields a map of topic partitions to offsets for the specified group. If the group doesn't
* * have a committed offset for a specific partition, the corresponding value in the returned map will be null.
* @param groupId The group ID.
* @return Future which yields a map of topic partitions to offsets for the specified group.
*/ */
public KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> partitionsToOffsetAndMetadata(String groupId) { public KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> partitionsToOffsetAndMetadata(String groupId) {
if (!futures.containsKey(groupId)) { if (!futures.containsKey(groupId)) {

View File

@ -50,7 +50,8 @@ public class ListStreamsGroupOffsetsResult {
} }
/** /**
* Return a future which yields a map of topic partitions to offsets for the specified group. * Return a future which yields a map of topic partitions to offsets for the specified group. If the group doesn't
* have a committed offset for a specific partition, the corresponding value in the returned map will be null.
*/ */
public KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> partitionsToOffsetAndMetadata(String groupId) { public KafkaFuture<Map<TopicPartition, OffsetAndMetadata>> partitionsToOffsetAndMetadata(String groupId) {
return delegate.partitionsToOffsetAndMetadata(groupId); return delegate.partitionsToOffsetAndMetadata(groupId);