jihoonson commented on a change in pull request #6203: Add support
targetCompactionSizeBytes for compactionTask
URL: https://github.com/apache/incubator-druid/pull/6203#discussion_r221115090
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java
##########
@@ -621,4 +653,96 @@ private static DimensionSchema createDimensionSchema(
return usedSegments;
}
}
+
+ @VisibleForTesting
+ static class PartitionConfigurationManager
+ {
+ @Nullable
+ private final Long targetCompactionSizeBytes;
+ @Nullable
+ private final IndexTuningConfig tuningConfig;
+
+ PartitionConfigurationManager(@Nullable Long targetCompactionSizeBytes,
@Nullable IndexTuningConfig tuningConfig)
+ {
+ this.targetCompactionSizeBytes =
getValidTargetCompactionSizeBytes(targetCompactionSizeBytes, tuningConfig);
+ this.tuningConfig = tuningConfig;
+ }
+
+ @Nullable
+ IndexTuningConfig computeTuningConfig(List<Pair<QueryableIndex,
DataSegment>> queryableIndexAndSegments)
+ {
+ if (!hasPartitionConfig(tuningConfig)) {
+ // Find IndexTuningConfig.targetPartitionSize which is the number of
rows per segment.
+ // Assume that the segment size is proportional to the number of rows.
We can improve this later.
+ final double avgRowsPerByte = queryableIndexAndSegments
+ .stream()
+ .mapToDouble(queryableIndexAndDataSegment -> {
+ final long numRows =
queryableIndexAndDataSegment.lhs.getNumRows();
Review comment:
Fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]