Skip to content

[HUDI-8883] Add ability to configure HoodieCompactionPlanGenerator using reflection#12664

Merged
nsivabalan merged 1 commit intoapache:masterfrom
vinishjail97:HUDI-8883-Plan-Generator
Feb 19, 2025
Merged

[HUDI-8883] Add ability to configure HoodieCompactionPlanGenerator using reflection#12664
nsivabalan merged 1 commit intoapache:masterfrom
vinishjail97:HUDI-8883-Plan-Generator

Conversation

@vinishjail97
Copy link
Contributor

@vinishjail97 vinishjail97 commented Jan 17, 2025

Change Logs

Compaction Planners can make use of extraMetadata to decide which partitions/file groups to compact, eg: extraMetadata can be used to keep track of previous compaction results.

Impact

Provides ability to write compaction planner which can make use of extraMetadata to decide which partitions/file groups to compact.

Risk level (write none, low medium or high below)

Low

Documentation Update

  public static final ConfigProperty<String> COMPACTION_PLAN_GENERATOR = ConfigProperty
      .key("hoodie.compaction.plan.generator")
      .defaultValue(HoodieCompactionPlanGenerator.class.getName())
      .markAdvanced()
      .withDocumentation("Compaction plan generator for data files. Override with a custom plan generator "
          + "if there's a need to use extraMetadata in the compaction plan for optimizations, ignore otherwise");

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Jan 17, 2025
.getTime() / 1000;
}

private BaseHoodieCompactionPlanGenerator createCompactionPlanGenerator(String planGeneratorClass, HoodieTable table, HoodieEngineContext context, HoodieWriteConfig config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have the stratefy classes why need to customize the plan generator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CompactionStrategy takes in the list of compaction operations and decides which ones to pick it up based on strategy logic. This is for the ability to keep track of metadata from previous compaction results in extraMetadata and then decide the plan.

@vinishjail97 vinishjail97 changed the title [HUDI-8883] Add ability to configure BaseHoodieCompactionPlanGenerator using reflection [HUDI-8883] Add ability to configure HoodieCompactionPlanGenerator using reflection Jan 30, 2025
@nsivabalan
Copy link
Contributor

can you add PR desc please.

Copy link
Contributor

@nsivabalan nsivabalan left a comment

Choose a reason for hiding this comment

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

does this reflect all latest changes.

@vinishjail97 vinishjail97 force-pushed the HUDI-8883-Plan-Generator branch from 1ad841b to 7beec7d Compare February 1, 2025 00:14
@github-actions github-actions bot added size:M PR with lines of changes in (100, 300] and removed size:S PR with lines of changes in (10, 100] labels Feb 1, 2025
@vinishjail97 vinishjail97 force-pushed the HUDI-8883-Plan-Generator branch from 7beec7d to cda0165 Compare February 10, 2025 22:38
@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@nsivabalan
Copy link
Contributor

image

@nsivabalan nsivabalan merged commit 5f64811 into apache:master Feb 19, 2025
43 of 45 checks passed
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 8, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 9, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:M PR with lines of changes in (100, 300]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants