Support segmentGranularity for auto-compaction#10843
Conversation
| @Nullable | ||
| private final Granularity segmentGranularity; | ||
| @Nullable | ||
| private final GranularitySpec granularitySpec; |
There was a problem hiding this comment.
You can remove this since it is no longer used
There was a problem hiding this comment.
What is no longer used?
| null | ||
| ); | ||
| } else { | ||
| this.granularitySpec = granularitySpec; |
There was a problem hiding this comment.
What happens if both segmentGranularity & granularitySpec are non-null?
There was a problem hiding this comment.
granularitySpec takes priority since segmentGranularity is deprecated.
There was a problem hiding this comment.
I'm not sure if we have a consistent stance on this but I think several places throw an exception if both the deprecated and new property are specified (such as Checks.checkOneNotNullOrEmpty usages).
I don't feel strongly about it, so I'm just mentioning this in case you feel that's a better approach.
| return new UniformGranularitySpec(segmentGranularity, queryGranularity, rollup, inputIntervals); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
Is it possible to move this to the abstract base class?
| // This is needed for datasource that has segmentGranularity configured | ||
| // If configured segmentGranularity is finer than current segmentGranularity, the same set of segments | ||
| // can belong to multiple intervals in the timeline. We keep track of the | ||
| private final Map<String, Set<Interval>> intervalCompactedForDatasource = new HashMap<>(); |
There was a problem hiding this comment.
Did you mean to add more to the comment?
| int partitions = segmentSet.size(); | ||
| for (DataSegment segment : segmentSet) { | ||
| DataSegment segmentsForCompact = segment.withShardSpec(new NumberedShardSpec(partitionNum, partitions)); | ||
| // PartitionHolder can only holds chucks of one partition space |
Support segmentGranularity for auto-compaction
Description
The auto-compaction configuration should support a segmentGranularity option like manual compaction task.
This PR has:
Key changed/added classes in this PR