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


##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:
##########
@@ -637,21 +622,22 @@ public List<OrderedPartitionableRecord<String, String, 
ByteEntity>> poll(long ti
     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<>(expectedSize);
 
-      Queues.drain(
-          records,
+      records.drain(
           polledRecords,
-          expectedSize,
+          MAX_BYTES_PER_POLL,

Review Comment:
   removed, and added `maxBytesPerPoll` which is being used instead now.



##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java:
##########
@@ -1059,11 +1045,23 @@ private void 
filterBufferAndResetBackgroundFetch(Set<StreamPartition<String>> pa
     }
 
     // filter records in buffer and only retain ones whose partition was not 
seeked
-    BlockingQueue<OrderedPartitionableRecord<String, String, ByteEntity>> newQ 
= new LinkedBlockingQueue<>(recordBufferSize);
+    MemoryBoundLinkedBlockingQueue<OrderedPartitionableRecord<String, String, 
ByteEntity>> newQ =
+        new MemoryBoundLinkedBlockingQueue<>(recordBufferSizeBytes);
 
     records.stream()
-           .filter(x -> !partitions.contains(x.getStreamPartition()))
-           .forEachOrdered(newQ::offer);
+        .filter(x -> !partitions.contains(x.getData().getStreamPartition()))
+        .forEachOrdered(x -> {
+          if (!newQ.offer(x)) {
+            // this should never really happen in practice but adding check 
here for safety.

Review Comment:
   thanks! updated



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