Skip to content

[HUDI-6462] Add Hudi client init callback interface#9108

Merged
nsivabalan merged 3 commits intoapache:masterfrom
yihua:HUDI-6462-client-init-callback
Jul 4, 2023
Merged

[HUDI-6462] Add Hudi client init callback interface#9108
nsivabalan merged 3 commits intoapache:masterfrom
yihua:HUDI-6462-client-init-callback

Conversation

@yihua
Copy link
Contributor

@yihua yihua commented Jul 1, 2023

Change Logs

This PR adds the interface for Hudi client init callback to run custom logic at the time of initialization of a Hudi client:

@PublicAPIClass(maturity = ApiMaturityLevel.EVOLVING)
public interface HoodieClientInitCallback {
  /**
   * A callback method in which the user can implement custom logic.
   * This method is called when a {@link BaseHoodieClient} is initialized.
   *
   * @param hoodieClient {@link BaseHoodieClient} instance.
   */
  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
  void call(BaseHoodieClient hoodieClient);
}

At the time of instantiation of the write or table service client, a user may want to do additional processing, such as sending metrics, logsm notification, or adding more properties to the write config. The implementation of client init callback interface allows such logic to be plugged into Hudi.

A new config, hoodie.client.init.callback.classes, is added for plugging in the callback implementation. The class list is comma-separated.

New tests are added and the behavior is expected.

Impact

Adds new functionality of client init callback to run custom logic at the time of initialization of a Hudi client.

Risk level

none

Documentation Update

Will update the Hudi docs.

Contributor's checklist

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

@yihua yihua force-pushed the HUDI-6462-client-init-callback branch from 3e1eef7 to 3fbcdb8 Compare July 1, 2023 05:57
@nsivabalan nsivabalan added the priority:blocker Production down; release blocker label Jul 1, 2023
@yihua yihua force-pushed the HUDI-6462-client-init-callback branch from 7f7dae8 to 9b67bc5 Compare July 3, 2023 23:45
@hudi-bot
Copy link
Collaborator

hudi-bot commented Jul 4, 2023

CI report:

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

@nsivabalan nsivabalan merged commit 4bba6af into apache:master Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:blocker Production down; release blocker release-0.14.0

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants