smjn commented on code in PR #22389:
URL: https://github.com/apache/kafka/pull/22389#discussion_r3315956736


##########
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:
   This refactor changes the semantics of the underlying replicaManager API. 
The original scala impl accepts a `List` of tuples of (topicIdPartitions, 
PartitionData) which implies same topic topicIdPartition could be included in 
parameters multiple times with different offset values which the hashmap 
disallows.



-- 
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]

Reply via email to