hachikuji commented on a change in pull request #8486:
URL: https://github.com/apache/kafka/pull/8486#discussion_r434245684



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/LogTruncationException.java
##########
@@ -33,18 +32,8 @@
  */
 public class LogTruncationException extends OffsetOutOfRangeException {
 
-    private final Map<TopicPartition, OffsetAndMetadata> divergentOffsets;
-
     public LogTruncationException(Map<TopicPartition, OffsetAndMetadata> 
divergentOffsets) {
-        super(Utils.transformMap(divergentOffsets, Function.identity(), 
OffsetAndMetadata::offset));
-        this.divergentOffsets = Collections.unmodifiableMap(divergentOffsets);
-    }
-
-    /**
-     * Get the offsets for the partitions which were truncated. This is the 
first offset which is known to diverge
-     * from what the consumer read.
-     */
-    public Map<TopicPartition, OffsetAndMetadata> divergentOffsets() {
-        return divergentOffsets;
+        super(Utils.transformMap(divergentOffsets, Function.identity(), 
OffsetAndMetadata::offset),

Review comment:
       Why make this change? We're losing the epoch information that is 
contained in `OffsetAndMetadata`. Note that this is a public API, so we cannot 
remove `divergentOffsets` without a KIP. 




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

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


Reply via email to