Skip to content

Refactor existing LWWElementSet implementation #6164

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 9 commits into from
Feb 13, 2025

Conversation

itakurah
Copy link
Contributor

Refactor of the existing LWWElementSet Implementation:

  • Added generic support to allow the set to store any type of element.

  • Updated Javadoc to reflect changes and improve clarity.

  • Refactored timestamp comparison to remove bias, following the recommendations outlined in A comprehensive study of Convergent and Commutative Replicated Data Types.

  • Removed the unused compare method, which is no longer needed due to updated timestamp comparison logic.

  • Updated existing test cases to align with changes in LWWElementSet implementation

  • Improved test readability and coverage

  • I have read CONTRIBUTING.md.

  • This pull request is all my own work -- I have not plagiarized it.

  • All filenames are in PascalCase.

  • All functions and variable names follow Java naming conventions.

  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

itakurah and others added 9 commits January 22, 2025 13:41
…s comparison

- Replaced int timestamps with Instant for improved precision
- Refactored class to be generic, allowing support for different types of elements
- Removed bias-based comparison to align with LWW-Element-Set
- Reference: https://inria.hal.science/inria-00555588v1/document
- Updated existing test cases to align with changes in LWWElementSet implementation
- Improved test readability and coverage
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.98%. Comparing base (3313ddc) to head (194e1a9).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ealgorithms/datastructures/crdt/LWWElementSet.java 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6164      +/-   ##
============================================
+ Coverage     73.94%   73.98%   +0.03%     
+ Complexity     5161     5159       -2     
============================================
  Files           662      662              
  Lines         17695    17681      -14     
  Branches       3412     3407       -5     
============================================
- Hits          13085    13081       -4     
+ Misses         4102     4097       -5     
+ Partials        508      503       -5     

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

@itakurah itakurah marked this pull request as ready for review February 13, 2025 12:02
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 63ce6b8 into TheAlgorithms:master Feb 13, 2025
6 checks passed
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.

3 participants