Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

DBZ-7845 [FEAT] adds reduced buffer implementation and test cases #75

Merged
merged 6 commits into from
May 14, 2024

Conversation

gaurav7261
Copy link
Contributor

@gaurav7261 gaurav7261 commented May 4, 2024

  1. adds reduced buffer
  2. created interface Buffer
  3. test cases for reduced buffer
  4. optimisation in buffer by avoiding copying in temporary buffer

Copy link

github-actions bot commented May 4, 2024

Welcome as a new contributor to Debezium, @gaurav7261. Reviewers, please add missing author name(s) and alias name(s) to the COPYRIGHT.txt and Aliases.txt respectively.

Copy link

github-actions bot commented May 4, 2024

Hi @gaurav7261, thanks for your contribution. Please prefix the commit message(s) with the DBZ-xxx JIRA issue key.

@gaurav7261 gaurav7261 changed the title [FEAT] adds reduced buffer implementation and test cases DBZ-7845 [FEAT] adds reduced buffer implementation and test cases May 4, 2024
@gaurav7261
Copy link
Contributor Author

gaurav7261 commented May 6, 2024

seems like checkstyle issue, looking into it, team any handy command that i can run to fix checkstyle, will be helpful => FIXED

Copy link

github-actions bot commented May 6, 2024

Hi @gaurav7261, thanks for your contribution. Please prefix the commit message(s) with the DBZ-xxx JIRA issue key.

Copy link
Member

@Naros Naros left a comment

Choose a reason for hiding this comment

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

Hi @gaurav7261, this looks good. I left a few inline suggestions and comments if you could take a look. Thanks!

@gaurav7261 gaurav7261 requested a review from Naros May 6, 2024 17:19
@gaurav7261
Copy link
Contributor Author

thanks for typo @Naros , i was pushing same

Copy link
Member

@Naros Naros left a comment

Choose a reason for hiding this comment

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

LGTM, a great first contribution @gaurav7261 🎉

@Naros Naros added the 2.7 label May 8, 2024
Copy link
Contributor

@jpechane jpechane left a comment

Choose a reason for hiding this comment

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

@gaurav7261 Thanks for the contribution! I left two comments related to two areas I am not sure I fully solved.


@Override
public List<SinkRecordDescriptor> add(SinkRecordDescriptor recordDescriptor) {
ArrayList<SinkRecordDescriptor> flushed = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

I see two issues here

  1. The type should be List
  2. Is there a way how to change the code so we can avoid copying the content of the buffer into the temporary variable? Ideally the result of method flush() should be returned directly. BTW I don't have problem if buffer size limit is temporarily broken in case of PK struct change to simplify that perf improvement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, working on it @jpechane

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have created a boolean variable isSchemaChanged to solve copying issue, raise a commit, please review @jpechane @Naros

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also @jpechane , the initial logic copying the content of the buffer into the temporary variable, but this is soft copy , keeping pointers only for SinkRecordDescriptor object , not exact SinkRecordDescriptor object copy, correct ? I'm not sure, how much perf improvement will be there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it is a soft copy but let's suppose that you have very large buffer set, then even soft copies can add over the time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also please bear in mind that we don't require single return from method so the code might at the end be easier to implement/comprehend if multiple returns are used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made the changes using variable isSchemaChanged, is it correct @jpechane ?

Copy link

github-actions bot commented May 9, 2024

Hi @gaurav7261, thanks for your contribution. Please prefix the commit message(s) with the DBZ-xxx JIRA issue key.

@jpechane jpechane merged commit 0b03ee6 into debezium:main May 14, 2024
7 checks passed
@jpechane
Copy link
Contributor

@gaurav7261 Applied, thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants