digitalpoetry commented on code in PR #13539:
URL: https://github.com/apache/druid/pull/13539#discussion_r1044928975
##########
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:
Ah, true
--
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]