zachjsh commented on code in PR #15360:
URL: https://github.com/apache/druid/pull/15360#discussion_r1412411405


##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:
##########
@@ -635,23 +620,19 @@ public List<OrderedPartitionableRecord<String, String, 
ByteEntity>> poll(long ti
     start();
 
     try {
-      int expectedSize = Math.min(Math.max(records.size(), 1), 
maxRecordsPerPoll);
-
-      List<OrderedPartitionableRecord<String, String, ByteEntity>> 
polledRecords = new ArrayList<>(expectedSize);
+      
List<MemoryBoundLinkedBlockingQueue.ObjectContainer<OrderedPartitionableRecord<String,
 String, ByteEntity>>> polledRecords = new ArrayList<>();
 
-      Queues.drain(
-          records,
+      records.drain(
           polledRecords,
-          expectedSize,
+          maxBytesPerPoll,

Review Comment:
   good question, it always drains at least one record, clarified that in the 
docs. I added a test for this, see 
org.apache.druid.java.util.common.MemoryBoundLinkedBlockingQueueTest#test_drain_queueWithFirstItemSizeGreaterThanLimit_succeeds



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to