CalvinConfluent commented on code in PR #13323: URL: https://github.com/apache/kafka/pull/13323#discussion_r1133024404
########## clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java: ########## @@ -144,18 +146,28 @@ public static class Builder extends AbstractRequest.Builder<FetchRequest> { public static Builder forConsumer(short maxVersion, int maxWait, int minBytes, Map<TopicPartition, PartitionData> fetchData) { return new Builder(ApiKeys.FETCH.oldestVersion(), maxVersion, - CONSUMER_REPLICA_ID, maxWait, minBytes, fetchData); + CONSUMER_REPLICA_ID, -1, maxWait, minBytes, fetchData); } - public static Builder forReplica(short allowedVersion, int replicaId, int maxWait, int minBytes, + public static Builder forReplica(short allowedVersion, int replicaId, long replicaEpoch, int maxWait, int minBytes, Map<TopicPartition, PartitionData> fetchData) { - return new Builder(allowedVersion, allowedVersion, replicaId, maxWait, minBytes, fetchData); + return new Builder(allowedVersion, allowedVersion, replicaId, replicaEpoch, maxWait, minBytes, fetchData); } - public Builder(short minVersion, short maxVersion, int replicaId, int maxWait, int minBytes, + public Builder(short minVersion, short maxVersion, int replicaId, long replicaEpoch, int maxWait, int minBytes, Map<TopicPartition, PartitionData> fetchData) { super(ApiKeys.FETCH, minVersion, maxVersion); this.replicaId = replicaId; + this.replicaEpoch = replicaEpoch; + this.maxWait = maxWait; + this.minBytes = minBytes; + this.toFetch = fetchData; + } + public Builder(short minVersion, short maxVersion, int replicaId, int maxWait, int minBytes, Review Comment: Good catch. the second one should be removed. -- 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