Repository: apache/kafka
File: clients/src/main/java/org/apache/kafka/common/requests/ListOffsetsRequest.java (Java)

Code before:
import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.ByteBufferAccessor;
import org.apache.kafka.common.protocol.Errors;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ListOffsetsRequest extends AbstractRequest {
    public static final long EARLIEST_TIMESTAMP = -2L;
    public static final long LATEST_TIMESTAMP = -1L;
    public static final long MAX_TIMESTAMP = -3L;

    /**
     * It is used to represent the earliest message stored in the local log which is also called the local-log-start-offset
     */
    public static final long EARLIEST_LOCAL_TIMESTAMP = -4L;

    public static final long LATEST_TIERED_TIMESTAMP = -5L;

    public static final long EARLIEST_PENDING_UPLOAD_OFFSET_TIMESTAMP = -6L;

    public static final int CONSUMER_REPLICA_ID = -1;
    public static final int DEBUGGING_REPLICA_ID = -2;

    private final ListOffsetsRequestData data;
    private final Set<TopicPartition> duplicatePartitions;

    public static class Builder extends AbstractRequest.Builder<ListOffsetsRequest> {
        private final ListOffsetsRequestData data;

        public static Builder forReplica(short allowedVersion, int replicaId) {
            return new Builder((short) 0, allowedVersion, replicaId, IsolationLevel.READ_UNCOMMITTED);
        }

        public static Builder forConsumer(boolean requireTimestamp,
                                          IsolationLevel isolationLevel,
                                          boolean requireMaxTimestamp,
                                          boolean requireTieredStorageTimestamp) {
            short minVersion = 0;
            if (requireTieredStorageTimestamp)
                minVersion = 9;
            else if (requireMaxTimestamp)
                minVersion = 7;
            else if (isolationLevel == IsolationLevel.READ_COMMITTED)
                minVersion = 2;

Review comment (suggestion):
consider renaming it to `EARLIEST_PENDING_UPLOAD_TIMESTAMP` for uniformity with other names.

Code after:
import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.Readable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ListOffsetsRequest extends AbstractRequest {
    public static final long EARLIEST_TIMESTAMP = -2L;
    public static final long LATEST_TIMESTAMP = -1L;
    public static final long MAX_TIMESTAMP = -3L;

    /**
     * It is used to represent the earliest message stored in the local log which is also called the local-log-start-offset
     */
    public static final long EARLIEST_LOCAL_TIMESTAMP = -4L;

    public static final long LATEST_TIERED_TIMESTAMP = -5L;

    public static final long EARLIEST_PENDING_UPLOAD_TIMESTAMP = -6L;

    public static final int CONSUMER_REPLICA_ID = -1;
    public static final int DEBUGGING_REPLICA_ID = -2;

    private final ListOffsetsRequestData data;
    private final Set<TopicPartition> duplicatePartitions;

    public static class Builder extends AbstractRequest.Builder<ListOffsetsRequest> {
        private final ListOffsetsRequestData data;

        public static Builder forConsumer(boolean requireTimestamp,
                                          IsolationLevel isolationLevel) {
            return forConsumer(requireTimestamp, isolationLevel, false, false, false, false);
        }

        public static Builder forConsumer(boolean requireTimestamp,
                                          IsolationLevel isolationLevel,
                                          boolean requireMaxTimestamp,
                                          boolean requireEarliestLocalTimestamp,
                                          boolean requireTieredStorageTimestamp,
                                          boolean requireEarliestPendingUploadTimestamp) {
            short minVersion = ApiKeys.LIST_OFFSETS.oldestVersion();
            if (requireEarliestPendingUploadTimestamp)
                minVersion = 11;
            else if (requireTieredStorageTimestamp)
                minVersion = 9;
            else if (requireEarliestLocalTimestamp)