apoorvmittal10 commented on code in PR #22389: URL: https://github.com/apache/kafka/pull/22389#discussion_r3316008095
########## server/src/main/java/org/apache/kafka/server/share/LogReader.java: ########## @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.kafka.server.share; + +import org.apache.kafka.common.TopicIdPartition; +import org.apache.kafka.server.storage.log.FetchParams; +import org.apache.kafka.storage.internals.log.LogReadResult; + +import java.util.LinkedHashMap; +import java.util.Set; + +/** + * Abstraction for reading records from log. + */ +public interface LogReader { + + /** + * Read records for the given partitions starting at the specified offsets. + * + * @param fetchParams The fetch parameters (isolation level, maxBytes, etc.) + * @param partitionsToFetch The set of partitions to actually fetch (after filtering erroneous ones) + * @param topicPartitionFetchOffsets The fetch offset per partition + * @param partitionMaxBytes The max bytes per partition + * @return A map of partition to log read result + */ + LinkedHashMap<TopicIdPartition, LogReadResult> read( Review Comment: But I don't think there is any use case where we send same topic id partition with different partition data ever. Do you think there is any? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
