Skip to content

[HUDI-8999] Improve usage of logging libraries #12172

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

Merged
merged 14 commits into from
Apr 25, 2025

Conversation

the-other-tim-brown
Copy link
Contributor

@the-other-tim-brown the-other-tim-brown commented Oct 27, 2024

Change Logs

  • Improves the usage of the logging libraries by leveraging slf4j's ability to lazily construct the log messages, especially for debug logs. This will reduce the new objects created and help with performance.
  • Remove usage of println where it is not required

Impact

  • Lowers runtime overhead due to logging (especially at debug level)

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

None

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

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:L PR with lines of changes in (300, 1000] label Oct 27, 2024
@the-other-tim-brown the-other-tim-brown changed the title Fix usage of logging libraries [HUDI-8999] Fix usage of logging libraries Feb 10, 2025
@the-other-tim-brown the-other-tim-brown changed the title [HUDI-8999] Fix usage of logging libraries [HUDI-8999] Improve usage of logging libraries Feb 10, 2025
@the-other-tim-brown the-other-tim-brown marked this pull request as ready for review February 10, 2025 21:41
@@ -360,23 +360,23 @@ public void updateArchiveMetrics(long durationInMs, int numInstantsArchived) {

public void updateFinalizeWriteMetrics(long durationInMs, long numFilesFinalized) {
if (config.isMetricsOn()) {
LOG.info(String.format("Sending finalize write metrics (%s=%d, %s=%d)", DURATION_STR, durationInMs,
FINALIZED_FILES_NUM_STR, numFilesFinalized));
LOG.debug("Sending finalize write metrics ({}={}, {}={})", DURATION_STR, durationInMs,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flagging this class: I changed the level to debug since we have metrics here the logging at info level seemed redundant.

@hudi-bot
Copy link

CI report:

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

@yihua yihua merged commit 412f2b4 into apache:master Apr 25, 2025
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L PR with lines of changes in (300, 1000]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants