chia7712 commented on code in PR #16872:
URL: https://github.com/apache/kafka/pull/16872#discussion_r1716592723
##########
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRecord.java:
##########
@@ -296,13 +223,23 @@ public Optional<Integer> leaderEpoch() {
return leaderEpoch;
}
+ /**
+ * Get the delivery count for the record if available
+ *
+ * @return the delivery count or empty when deliveries not counted
Review Comment:
thanks for explanation.
for another: `ConsumerRecord` is a common structure used by all group
protocol, but this field is for shared protocol exclusive use. hence, should we
add those comments to it?
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java:
##########
@@ -306,12 +306,11 @@ <K, V> ConsumerRecord<K, V> parseRecord(final
Deserializers<K, V> deserializers,
log.error("Value Deserializers with error: {}", deserializers);
throw
newRecordDeserializationException(RecordDeserializationException.DeserializationExceptionOrigin.VALUE,
partition.topicPartition(), timestampType, record, e, headers);
}
- // When ConsumerRecord gains the delivery count, add it here
return new ConsumerRecord<>(partition.topic(), partition.partition(),
record.offset(),
record.timestamp(), timestampType,
keyBytes == null ? ConsumerRecord.NULL_SIZE :
keyBytes.remaining(),
valueBytes == null ? ConsumerRecord.NULL_SIZE :
valueBytes.remaining(),
- key, value, headers, leaderEpoch);
+ key, value, headers, leaderEpoch, Optional.of(deliveryCount));
Review Comment:
`deliveryCount` has been used now, so could you please remove
`@SuppressWarnings("UnusedParameters")` ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]