This is an automated email from the ASF dual-hosted git repository. showuon pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new add11ee MINOR: Correct logging and Javadoc in FetchSessionHandler (#11843) add11ee is described below commit add11eed752e3ee912e469245cc7cf56914ae07f Author: Adam Kotwasinski <adam.kotwasin...@gmail.com> AuthorDate: Wed Mar 9 00:51:26 2022 -0800 MINOR: Correct logging and Javadoc in FetchSessionHandler (#11843) Reviewers: Justine Olshan <jols...@confluent.io>, David Jacot <david.ja...@gmail.com>, Luke Chen <show...@gmail.com> --- .../java/org/apache/kafka/clients/FetchSessionHandler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java b/clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java index aca847c..739a476 100644 --- a/clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java +++ b/clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java @@ -402,7 +402,7 @@ public class FetchSessionHandler { * * @param toFind The items to look for. * @param toSearch The set of items to search. - * @return null if all items were found; some of the missing ones in a set, if not. + * @return Empty set if all items were found; some of the missing ones in a set, if not. */ static <T> Set<T> findMissing(Set<T> toFind, Set<T> toSearch) { Set<T> ret = new LinkedHashSet<>(); @@ -420,7 +420,7 @@ public class FetchSessionHandler { * @param topicPartitions The topicPartitions from the FetchResponse. * @param ids The topic IDs from the FetchResponse. * @param version The version of the FetchResponse. - * @return True if the full fetch response partitions are valid. + * @return null if the full fetch response partitions are valid; human-readable problem description otherwise. */ String verifyFullFetchResponsePartitions(Set<TopicPartition> topicPartitions, Set<Uuid> ids, short version) { StringBuilder bld = new StringBuilder(); @@ -454,7 +454,7 @@ public class FetchSessionHandler { * @param topicPartitions The topicPartitions from the FetchResponse. * @param ids The topic IDs from the FetchResponse. * @param version The version of the FetchResponse. - * @return True if the incremental fetch response partitions are valid. + * @return null if the incremental fetch response partitions are valid; human-readable problem description otherwise. */ String verifyIncrementalFetchResponsePartitions(Set<TopicPartition> topicPartitions, Set<Uuid> ids, short version) { Set<Uuid> extraIds = new HashSet<>(); @@ -464,9 +464,9 @@ public class FetchSessionHandler { Set<TopicPartition> extra = findMissing(topicPartitions, sessionPartitions.keySet()); StringBuilder bld = new StringBuilder(); - if (extra.isEmpty()) + if (!extra.isEmpty()) bld.append("extraPartitions=(").append(Utils.join(extra, ", ")).append("), "); - if (extraIds.isEmpty()) + if (!extraIds.isEmpty()) bld.append("extraIds=(").append(Utils.join(extraIds, ", ")).append("), "); if ((!extra.isEmpty()) || (!extraIds.isEmpty())) { bld.append("response=(").append(Utils.join(topicPartitions, ", ")).append(")");