ijuma commented on a change in pull request #9758: URL: https://github.com/apache/kafka/pull/9758#discussion_r584151716
########## File path: clients/src/main/java/org/apache/kafka/common/requests/FetchResponse.java ########## @@ -57,238 +56,39 @@ * the fetch offset after the index lookup * - {@link Errors#UNKNOWN_SERVER_ERROR} For any unexpected errors */ -public class FetchResponse<T extends BaseRecords> extends AbstractResponse { - - public static final long INVALID_HIGHWATERMARK = -1L; +public class FetchResponse extends AbstractResponse { + public static final long INVALID_HIGH_WATERMARK = -1L; public static final long INVALID_LAST_STABLE_OFFSET = -1L; public static final long INVALID_LOG_START_OFFSET = -1L; public static final int INVALID_PREFERRED_REPLICA_ID = -1; private final FetchResponseData data; - private final LinkedHashMap<TopicPartition, PartitionData<T>> responseDataMap; + // we build responseData when needed. + private LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> responseData = null; Review comment: Yeah, you can use a volatile field and synchronize on the assignment if still null. And then file a separate Jira to remove it from the class in a separate PR. ---------------------------------------------------------------- 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