chia7712 commented on code in PR #17322:
URL: https://github.com/apache/kafka/pull/17322#discussion_r1811253140
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1138,6 +1185,7 @@ private void acquireSubsetBatchRecords(
} finally {
lock.writeLock().unlock();
}
+ return result.size();
Review Comment:
Apologies, but why don't we return the count of AcquiredRecords added to the
result in this method? Since result is reused by the caller, result.size won't
equal the count of the subset, correct?
##########
share/src/main/java/org/apache/kafka/server/share/fetch/ShareAcquiredRecords.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.fetch;
+
+import org.apache.kafka.common.message.ShareFetchResponseData.AcquiredRecords;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The ShareAcquiredRecords class is used to send the acquired records and
associated metadata.
+ */
+public class ShareAcquiredRecords {
+
+ public static final ShareAcquiredRecords EMPTY_SHARE_ACQUIRED_RECORDS =
new ShareAcquiredRecords();
Review Comment:
it is used internally, so could you please change it from public to private?
--
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]