digitalpoetry commented on code in PR #13539:
URL: https://github.com/apache/druid/pull/13539#discussion_r1044404738


##########
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisIndexTaskIOConfig.java:
##########
@@ -202,31 +215,55 @@ public String getEndpoint()
     return endpoint;
   }
 
-  @JsonProperty
-  public int getRecordsPerFetch()
+  @Nullable
+  @JsonProperty("recordsPerFetch")
+  @JsonInclude(JsonInclude.Include.NON_NULL)
+  public Integer getRecordsPerFetchConfigured()
   {
     return recordsPerFetch;
   }
 
+  public int getRecordsPerFetchOrDefault(final long maxHeapSize, final int 
fetchThreads)
+  {
+    if (recordsPerFetch != null) {
+      return recordsPerFetch;
+    } else {
+      final long memoryToUse = Math.min(
+          MAX_RECORD_FETCH_MEMORY,
+          (long) (maxHeapSize * RECORD_FETCH_MEMORY_MAX_HEAP_FRACTION)
+      );
+
+      final int assumedRecordSize = deaggregate
+                                    ? 
KinesisIndexTaskTuningConfig.ASSUMED_RECORD_SIZE_AGGREGATE
+                                    : 
KinesisIndexTaskTuningConfig.ASSUMED_RECORD_SIZE;
+
+      return Ints.checkedCast(Math.max(1, memoryToUse / assumedRecordSize / 
fetchThreads));

Review Comment:
   Am I right to assume that for a 1GB-heap task with deaggregate=true and 1 
available processor, the default recordsPerFetch from this calculation is 25?
   ```
   memoryToUse = min(100_000_000, 1_000_000_000 * 0.05) = 50_000_000
   assumedRecordSize = 1_000_000
   recordsPerFetch = 50_000_000 / 1_000_000 / 2 = 25
   ```
   
   If we carry the assumption that each record is 1MB, I think this result 
conflicts with the maximum size of data that GetRecords can return, which is 10 
MB.



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