// Path: src/main/java/kafka/common/TopicAndPartition.java
// public class TopicAndPartition {
//     public final String topic;
//     public final int partition;
// 
//     public TopicAndPartition(String topic, int partition) {
//         this.topic = topic;
//         this.partition = partition;
//     }
// 
//     public TopicAndPartition(Tuple2<String, Integer> tuple) {
//         this(tuple._1, tuple._2);
//     }
// 
//     public TopicAndPartition(Partition partition) {
//         this(partition.topic, partition.partitionId);
//     }
// 
//     public TopicAndPartition(Replica replica) {
//         this(replica.topic, replica.partitionId);
//     }
// 
//     public Tuple2<String, Integer> asTuple() {
//         return Tuple2.make(topic, partition);
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("[%s,%d]", topic, partition);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         TopicAndPartition that = (TopicAndPartition) o;
// 
//         if (partition != that.partition) return false;
//         if (topic != null ? !topic.equals(that.topic) : that.topic != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = topic != null ? topic.hashCode() : 0;
//         result = 31 * result + partition;
//         return result;
//     }
// }
// 
// Path: src/main/java/kafka/consumer/ConsumerConfigs.java
// public class ConsumerConfigs {
//     public final static int RefreshMetadataBackoffMs = 200;
//     public final static int SocketTimeout = 30 * 1000;
//     public final static int SocketBufferSize = 64 * 1024;
//     public final static int FetchSize = 1024 * 1024;
//     public final static int MaxFetchSize = 10 * FetchSize;
//     public final static int DefaultFetcherBackoffMs = 1000;
//     public final static boolean AutoCommit = true;
//     public final static int AutoCommitInterval = 60 * 1000;
//     public final static int MaxQueuedChunks = 2;
//     public final static int MaxRebalanceRetries = 4;
//     public final static String AutoOffsetReset = OffsetRequestReader.LargestTimeString;
//     public final static int ConsumerTimeoutMs = -1;
//     public final static int MinFetchBytes = 1;
//     public final static int MaxFetchWaitMs = 100;
//     public final static String MirrorTopicsWhitelist = "";
//     public final static String MirrorTopicsBlacklist = "";
//     public final static int MirrorConsumerNumThreads = 1;
// 
//     public final static String MirrorTopicsWhitelistProp = "mirror.topics.whitelist";
//     public final static String MirrorTopicsBlacklistProp = "mirror.topics.blacklist";
//     public final static String MirrorConsumerNumThreadsProp = "mirror.consumer.numthreads";
//     public final static String DefaultClientId = "";
// 
//     public static void validate(ConsumerConfig config) {
//         validateClientId(config.clientId);
//         validateGroupId(config.groupId);
//         validateAutoOffsetReset(config.autoOffsetReset);
//     }
// 
//     public static void validateClientId(String clientId) {
//         Config.validateChars("client.id", clientId);
//     }
// 
//     public static void validateGroupId(String groupId) {
//         Config.validateChars("group.id", groupId);
//     }
// 
//     public static void validateAutoOffsetReset(String autoOffsetReset) {
//         if (autoOffsetReset == OffsetRequestReader.SmallestTimeString) {
//         } else if (autoOffsetReset == OffsetRequestReader.LargestTimeString) {
//         } else {
//             throw new InvalidConfigException("Wrong value " + autoOffsetReset + " of auto.offset.reset in ConsumerConfig; " +
//                     "Valid values are " + OffsetRequestReader.SmallestTimeString + " and " + OffsetRequestReader.LargestTimeString);
//         }
//     }
// }


import com.google.common.collect.Maps;
import kafka.common.TopicAndPartition;
import kafka.consumer.ConsumerConfigs;
import kafka.utils.NonThreadSafe;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
package kafka.api;



@NonThreadSafe
public class FetchRequestBuilder {
    private AtomicInteger correlationId = new AtomicInteger(0);
    private short versionId = FetchRequestReader.CurrentVersion;
    private String clientId = ConsumerConfigs.DefaultClientId;
    private int replicaId = Requests.OrdinaryConsumerId;
    private int maxWait = FetchRequestReader.DefaultMaxWait;
    private int minBytes = FetchRequestReader.DefaultMinBytes;
// Path: src/main/java/kafka/common/TopicAndPartition.java
// public class TopicAndPartition {
//     public final String topic;
//     public final int partition;
// 
//     public TopicAndPartition(String topic, int partition) {
//         this.topic = topic;
//         this.partition = partition;
//     }
// 
//     public TopicAndPartition(Tuple2<String, Integer> tuple) {
//         this(tuple._1, tuple._2);
//     }
// 
//     public TopicAndPartition(Partition partition) {
//         this(partition.topic, partition.partitionId);
//     }
// 
//     public TopicAndPartition(Replica replica) {
//         this(replica.topic, replica.partitionId);
//     }
// 
//     public Tuple2<String, Integer> asTuple() {
//         return Tuple2.make(topic, partition);
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("[%s,%d]", topic, partition);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         TopicAndPartition that = (TopicAndPartition) o;
// 
//         if (partition != that.partition) return false;
//         if (topic != null ? !topic.equals(that.topic) : that.topic != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = topic != null ? topic.hashCode() : 0;
//         result = 31 * result + partition;
//         return result;
//     }
// }
// 
// Path: src/main/java/kafka/consumer/ConsumerConfigs.java
// public class ConsumerConfigs {
//     public final static int RefreshMetadataBackoffMs = 200;
//     public final static int SocketTimeout = 30 * 1000;
//     public final static int SocketBufferSize = 64 * 1024;
//     public final static int FetchSize = 1024 * 1024;
//     public final static int MaxFetchSize = 10 * FetchSize;
//     public final static int DefaultFetcherBackoffMs = 1000;
//     public final static boolean AutoCommit = true;
//     public final static int AutoCommitInterval = 60 * 1000;
//     public final static int MaxQueuedChunks = 2;
//     public final static int MaxRebalanceRetries = 4;
//     public final static String AutoOffsetReset = OffsetRequestReader.LargestTimeString;
//     public final static int ConsumerTimeoutMs = -1;
//     public final static int MinFetchBytes = 1;
//     public final static int MaxFetchWaitMs = 100;
//     public final static String MirrorTopicsWhitelist = "";
//     public final static String MirrorTopicsBlacklist = "";
//     public final static int MirrorConsumerNumThreads = 1;
// 
//     public final static String MirrorTopicsWhitelistProp = "mirror.topics.whitelist";
//     public final static String MirrorTopicsBlacklistProp = "mirror.topics.blacklist";
//     public final static String MirrorConsumerNumThreadsProp = "mirror.consumer.numthreads";
//     public final static String DefaultClientId = "";
// 
//     public static void validate(ConsumerConfig config) {
//         validateClientId(config.clientId);
//         validateGroupId(config.groupId);
//         validateAutoOffsetReset(config.autoOffsetReset);
//     }
// 
//     public static void validateClientId(String clientId) {
//         Config.validateChars("client.id", clientId);
//     }
// 
//     public static void validateGroupId(String groupId) {
//         Config.validateChars("group.id", groupId);
//     }
// 
//     public static void validateAutoOffsetReset(String autoOffsetReset) {
//         if (autoOffsetReset == OffsetRequestReader.SmallestTimeString) {
//         } else if (autoOffsetReset == OffsetRequestReader.LargestTimeString) {
//         } else {
//             throw new InvalidConfigException("Wrong value " + autoOffsetReset + " of auto.offset.reset in ConsumerConfig; " +
//                     "Valid values are " + OffsetRequestReader.SmallestTimeString + " and " + OffsetRequestReader.LargestTimeString);
//         }
//     }
// }


// Path: src/main/java/kafka/api/FetchRequestBuilder.java
import com.google.common.collect.Maps;
import kafka.common.TopicAndPartition;
import kafka.consumer.ConsumerConfigs;
import kafka.utils.NonThreadSafe;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

package kafka.api;



@NonThreadSafe
public class FetchRequestBuilder {
    private AtomicInteger correlationId = new AtomicInteger(0);
    private short versionId = FetchRequestReader.CurrentVersion;
    private String clientId = ConsumerConfigs.DefaultClientId;
    private int replicaId = Requests.OrdinaryConsumerId;
    private int maxWait = FetchRequestReader.DefaultMaxWait;
    private int minBytes = FetchRequestReader.DefaultMinBytes;
    private Map<TopicAndPartition, PartitionFetchInfo> requestMap = Maps.newHashMap();