Skip to content

MINOR: conditionally log "Sink record with view" traces#896

Open
James Yuzawa (yuzawa-san) wants to merge 1 commit into
confluentinc:masterfrom
yuzawa-san:log-sink-record-trace
Open

MINOR: conditionally log "Sink record with view" traces#896
James Yuzawa (yuzawa-san) wants to merge 1 commit into
confluentinc:masterfrom
yuzawa-san:log-sink-record-trace

Conversation

@yuzawa-san

@yuzawa-san James Yuzawa (yuzawa-san) commented Jan 9, 2026

Copy link
Copy Markdown

Problem

there is a memory hotspot here. the log message is assembled regardless the log level.

logtrace

Solution

solution is to gate it by checking isTraceEnabled()

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

check flamecharts again

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

minor

Copilot AI review requested due to automatic review settings January 9, 2026 18:21
@yuzawa-san James Yuzawa (yuzawa-san) requested a review from a team as a code owner January 9, 2026 18:21
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ yuzawa-san
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a performance issue where expensive log message assembly was occurring regardless of the configured log level. The solution wraps trace log statements with isTraceEnabled() checks to prevent unnecessary string conversion operations.

Key Changes:

  • Added isTraceEnabled() guards around trace logging statements in four record writer providers
  • Prevents the expensive sinkRecordToLoggableString(record) method from being called when trace logging is disabled

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
ParquetRecordWriterProvider.java Added isTraceEnabled() guard to prevent unnecessary trace log message assembly
JsonRecordWriterProvider.java Added isTraceEnabled() guard to prevent unnecessary trace log message assembly
ByteArrayRecordWriterProvider.java Added isTraceEnabled() guard to prevent unnecessary trace log message assembly
AvroRecordWriterProvider.java Added isTraceEnabled() guard to prevent unnecessary trace log message assembly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yuzawa-san

Copy link
Copy Markdown
Author

could you please take a look at this?

1 similar comment
@yuzawa-san

Copy link
Copy Markdown
Author

could you please take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants