Skip to content
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

cached messages #429

Merged
merged 7 commits into from
Aug 22, 2023
Merged

cached messages #429

merged 7 commits into from
Aug 22, 2023

Conversation

l3r8yJ
Copy link
Member

@l3r8yJ l3r8yJ commented Aug 20, 2023

closes #428

@h1alexbel take a look, please


PR-Codex overview

This PR focuses on improving the caching mechanism in the Timestamped and WithPartition classes.

Detailed summary

  • Added imports for Scalar, Sticky, and Synced
  • Changed the type of the message field in Timestamped and WithPartition to Scalar<ProducerRecord<K, X>>
  • Updated the constructor of Timestamped and WithPartition to use Synced and Sticky for caching
  • Added a todo comment to write tests for the caching mechanism in both classes

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@zoeself
Copy link
Collaborator

zoeself commented Aug 20, 2023

@l3r8yJ thank you for your Pull Request. I'll assign someone to review it soon.

If this PR solves a todo from the code, please don't forget to remove it.

@l3r8yJ l3r8yJ requested a review from h1alexbel August 20, 2023 18:03
@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5159a40) 99.00% compared to head (023fbe8) 99.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #429   +/-   ##
=========================================
  Coverage     99.00%   99.00%           
  Complexity      173      173           
=========================================
  Files            82       82           
  Lines           504      504           
  Branches          1        1           
=========================================
  Hits            499      499           
  Misses            5        5           
Files Changed Coverage Δ
.../java/io/github/eocqrs/kafka/xml/XmlMapParams.java 100.00% <ø> (ø)
.../java/io/github/eocqrs/kafka/data/Timestamped.java 100.00% <100.00%> (ø)
...ava/io/github/eocqrs/kafka/data/WithPartition.java 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zoeself
Copy link
Collaborator

zoeself commented Aug 20, 2023

@h1alexbel please review this Pull Request. Deadline (when it should be merged or closed) is 2023-08-23T17:59:09.750988.

You should check if the requirements have been implemented (partially or in full), if there are unit tests covering the changes and if the CI build passes. Feel free to reject the PR or ask for changes if it's too big or not clear enough.

Estimation here is 30 minutes, that's how much you will be paid. You will be paid even if this PR gets rejected.

@h1alexbel
Copy link
Member

@l3r8yJ can we introduce any tests on this?

@l3r8yJ
Copy link
Member Author

l3r8yJ commented Aug 21, 2023

@h1alexbel I'll create a puzzle

@l3r8yJ l3r8yJ requested a review from h1alexbel August 21, 2023 15:20
@l3r8yJ
Copy link
Member Author

l3r8yJ commented Aug 21, 2023

@h1alexbel take a look, please

@zoeself
Copy link
Collaborator

zoeself commented Aug 22, 2023

@h1alexbel Don't forget to close this ticket before the deadline (2023-08-23T17:59:10). You are past the first half of the allowed period.

Copy link
Member

@h1alexbel h1alexbel left a comment

Choose a reason for hiding this comment

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

@l3r8yJ Overall looks good, but also, I have a few questions

@@ -55,7 +64,7 @@ public WithPartition(
final Message<K, X> msg
) {
this.partition = prtn;
this.message = msg;
this.message = new Synced<>(new Sticky<>(msg));
Copy link
Member

Choose a reason for hiding this comment

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

@l3r8yJ why we are doing Sync here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@h1alexbel Due to the fact that Sticky is not thread-safe by default

@h1alexbel
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Aug 22, 2023

@rultor merge

@h1alexbel OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 023fbe8 into eo-cqrs:master Aug 22, 2023
8 checks passed
@rultor
Copy link
Collaborator

rultor commented Aug 22, 2023

@rultor merge

@h1alexbel Done! FYI, the full log is here (took me 2min)

@l3r8yJ l3r8yJ deleted the 428 branch August 22, 2023 09:16
@h1alexbel
Copy link
Member

@l3r8yJ thanks

@zoeself
Copy link
Collaborator

zoeself commented Aug 22, 2023

@h1alexbel thank you for resolving this ticket. I've just added it to your active invoice. You can always check all your invoices and more on the Contributor Dashboard.

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.

Cached message
5 participants