-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support segmentGranularity for auto-compaction #10843
Conversation
@@ -141,6 +141,8 @@ | |||
@Nullable | |||
private final Granularity segmentGranularity; | |||
@Nullable | |||
private final GranularitySpec granularitySpec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this since it is no longer used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is no longer used?
null | ||
); | ||
} else { | ||
this.granularitySpec = granularitySpec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if both segmentGranularity & granularitySpec are non-null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
granularitySpec takes priority since segmentGranularity is deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -139,10 +138,18 @@ public GranularitySpec withIntervals(List<Interval> inputIntervals) | |||
return new UniformGranularitySpec(segmentGranularity, queryGranularity, rollup, inputIntervals); | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to move this to the abstract base class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Done.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to add more to the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chucks -> chunks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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