Skip to content
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

Add rollup config to auto and manual compaction #11850

Merged
merged 5 commits into from
Oct 29, 2021

Conversation

maytasm
Copy link
Contributor

@maytasm maytasm commented Oct 27, 2021

Add rollup config to auto and manual compaction

Description

Add rollup to auto compaction and manual compaction.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

// Same indexSpec as what is set in the auto compaction config
Map<String, Object> indexSpec = mapper.convertValue(new IndexSpec(), new TypeReference<Map<String, Object>>() {});
// Same partitionsSpec as what is set in the auto compaction config
PartitionsSpec partitionsSpec = NewestSegmentFirstIterator.findPartitinosSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(null, null));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, there is a typo in there findPartitinosSpecFromConfig -> findPartitionsSpecFromConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// rollup=false for interval 2017-10-01T00:00:00/2017-10-02T00:00:00,
// rollup=true for interval 2017-10-02T00:00:00/2017-10-03T00:00:00,
// and rollup=null for interval 2017-10-03T00:00:00/2017-10-04T00:00:00
final VersionedIntervalTimeline<String, DataSegment> timeline = createTimeline(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a test that segments in the same compaction state with rollup are not re-compacted? or is that covered automatically by another test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should also cover that case. Here we have:

  • segments with interval 2017-10-01T00:00:00/2017-10-02T00:00:00 and rollup=false in compaction state
  • segments with interval 2017-10-02T00:00:00/2017-10-03T00:00:00 and rollup=true in compaction state
  • segments with interval 2017-10-03T00:00:00/2017-10-04T00:00:00 and rollup=null in compaction state (this means that the last time this segment/interval was compacted, the rollup value was not set in the auto compaction config).
    Then we set auto compaction config with rollup=true.
    We then expect that the segments with interval 2017-10-02T00:00:00/2017-10-03T00:00:00 are not returned since rollup in last compaction state is same as auto compaction config
    We expect segments with interval 2017-10-01T00:00:00/2017-10-02T00:00:00 and segments with interval 2017-10-03T00:00:00/2017-10-04T00:00:00 to be returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that what you are thinking or is it something else?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, oops 👍

@maytasm maytasm merged commit 33d9d9b into apache:master Oct 29, 2021
@maytasm maytasm deleted the IMPLY-11783 branch October 29, 2021 17:22
@abhishekagarwal87 abhishekagarwal87 added this to the 0.23.0 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants