Skip to content

Pure #1

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 18 commits into from
Mar 31, 2025
Merged

Pure #1

merged 18 commits into from
Mar 31, 2025

Conversation

magicprinc
Copy link
Owner

total refactoring v0.3.0

Copy link

coderabbitai bot commented Mar 31, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes update build configurations and reorganize several modules. In the build scripts, Error-Prone settings are commented out, duplicate class strategies are adjusted, and Gradle scripts are added or modified. Packages and dependency declarations in gradle.properties are refined. Across the codebase, several benchmark helper classes and implementations have been introduced or refactored with updated access modifiers and type changes (e.g. using concurrent maps). Multiple legacy map interfaces have been removed in favor of refactored implementations and new builder patterns. Test files have been updated to reflect these package and type changes.

Changes

File(s) Change Summary
build.gradle, gradle.properties, gradlew, gradlew.bat, settings.gradle Commented out Error-Prone configurations; updated JMH duplicate class strategy; removed quotes and updated version in gradle.properties; added new Gradle startup scripts; introduced a pluginManagement block.
src/jmh/java/com/trivago/kangaroo/{AbstractBenchHelper.java, AbstractCommonBenchHelper.java, FastutilWrapperBusyWaitingBenchmark.java, FastutilWrapperDefaultBenchmark.java, JavaUtilWrapperBenchmark.java} Updated map type from LongLongMap to ConcurrentLongLongMap; standardized access modifiers; changed method call in loadData; added @OverRide annotations and doc comments.
src/jmh/java/com/trivago/kangaroo/long2long/... Introduced a new abstract helper (AbstractLongLongBenchHelper) and several benchmark classes (e.g. FastutilWrapperBusyWaitingLongLongBenchmark, JavaConcurrentLongLongBenchmark) incorporating JMH annotations and specific loadData setups.
src/jmh/java/com/trivago/kangaroo/object2long/... Added a new abstract helper (AbstractObjectLongBenchHelper), benchmark classes (e.g. FastutilWrapperBusyWaitingObjectLongBenchmark, JavaUtilWrapperObjectLongBenchmark), and a new TestObjectKey to support object-to-long mapping benchmarks.
src/main/java/com/trivago/fastutilconcurrentwrapper/{IntFloatMap.java, IntIntMap.java, LongFloatMap.java, LongIntMap.java, LongLongMap.java} Removed legacy map interfaces for primitive mappings.
src/main/java/com/trivago/fastutilconcurrentwrapper/PrimitiveConcurrentMap.java Changed package declaration; added bucket number validation; modified getBucket to accept an Object; updated static helper method visibility.
src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/... Refactored maps (e.g. ConcurrentBusyWaitingIntFloatMap.java, ConcurrentIntFloatMap.java) by moving them to the intkey package; simplified constructors; adjusted field access and added builder methods.
src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/... Refactored long-keyed maps (e.g. ConcurrentBusyWaitingLongFloatMap.java, ConcurrentLongIntMap.java); moved files to the longkey package; simplified constructors and removed redundant methods; added builder methods and a new ConcurrentBusyWaitingLongObjectMap.
src/main/java/com/trivago/fastutilconcurrentwrapper/objkey/... Introduced new map classes (ConcurrentBusyWaitingObjectLongMap.java, ConcurrentObjectLongMap.java) for object-to-long mappings with busy-waiting and builder support.
src/test/java/com/trivago/fastutilconcurrentwrapper/... Updated imports, variable types, and assertions across various test files (intkey, longint, longlong, etc.) to reflect package reorganizations and use of concurrent implementations.
src/test/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentObjectLongMapBuilderTest.java Added new tests validating builder functionality for ConcurrentObjectLongMap in both busy-waiting and blocking modes.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as JMH Runner
    participant Benchmark as Benchmark Class
    participant Builder as Map Builder
    Runner->>Benchmark: Invoke @Setup(loadData)
    Benchmark->>Benchmark: Call initAndLoadData(mode)
    Note right of Benchmark: Initializes concurrent maps
    Runner->>Benchmark: Execute testGet()/testPut()/testAllOps()
    Benchmark-->>Runner: Return operation results
    Runner->>Builder: Invoke newBuilder() for map creation
    Builder-->>Runner: Return constructed map instance
Loading

Poem

Oh, how my paws do tap and play,
Updating builds throughout the day.
Concurrency refined with maps anew,
Benchmarks sparkle in the code view.
I hop with joy, my whiskers a-flight,
For each refactored line shines oh so bright!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 885da55 and d149443.

⛔ Files ignored due to path filters (2)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar, !**/*.jar
  • jitpack.yml is excluded by !**/*.yml
📒 Files selected for processing (57)
  • build.gradle (4 hunks)
  • gradle.properties (1 hunks)
  • gradlew (1 hunks)
  • gradlew.bat (1 hunks)
  • settings.gradle (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/AbstractBenchHelper.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/AbstractCommonBenchHelper.java (2 hunks)
  • src/jmh/java/com/trivago/kangaroo/FastutilWrapperBusyWaitingBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/FastutilWrapperDefaultBenchmark.java (0 hunks)
  • src/jmh/java/com/trivago/kangaroo/JavaUtilWrapperBenchmark.java (3 hunks)
  • src/jmh/java/com/trivago/kangaroo/long2long/AbstractLongLongBenchHelper.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/long2long/FastutilWrapperBusyWaitingLongLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/long2long/FastutilWrapperDefaultLongLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/long2long/JavaConcurrentLongLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/long2long/JavaUtilWrapperLongLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/AbstractObjectLongBenchHelper.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/FastutilWrapperBusyWaitingObjectLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/FastutilWrapperDefaultObjectLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/JavaConcurrentObjectLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/JavaUtilWrapperObjectLongBenchmark.java (1 hunks)
  • src/jmh/java/com/trivago/kangaroo/object2long/TestObjectKey.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/IntFloatMap.java (0 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/IntIntMap.java (0 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/LongFloatMap.java (0 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/LongIntMap.java (0 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/LongLongMap.java (0 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/PrimitiveConcurrentMap.java (3 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentBusyWaitingIntFloatMap.java (7 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentBusyWaitingIntIntMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentIntFloatMap.java (3 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentIntIntMap.java (3 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongFloatMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongIntMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongLongMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongObjectMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongFloatMap.java (3 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongIntMap.java (3 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongLongMap.java (4 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongObjectMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentBusyWaitingObjectLongMap.java (1 hunks)
  • src/main/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentObjectLongMap.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentIntFloatMapBuilderTest.java (3 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentIntIntMapBuilderTest.java (3 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongFloatMapBuilderTest.java (3 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongIntMapBuilderTest.java (3 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongLongMapBuilderTest.java (3 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentBusyWaitingIntFloatMapTest.java (2 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/intkey/PrimitiveConcurrentMapTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longint/AbstractLongIntMapTest.java (2 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longint/ConcurrentBusyWaitingLongIntMapTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longint/ConcurrentPrimitiveLongIntMapTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longint/PrimitiveFastutilLongIntWrapperTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longlong/AbstractLongLongMapTest.java (15 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longlong/ConcurrentBusyWaitingLongLongMapTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longlong/ConcurrentLongLongMapTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/longlong/PrimitiveFastutilLongLongWrapperTest.java (1 hunks)
  • src/test/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentObjectLongMapBuilderTest.java (1 hunks)
✨ Finishing Touches
  • 📝 Docstrings were successfully generated. (🔄 Check again to generate docstrings again)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@magicprinc magicprinc merged commit ecaa829 into master Mar 31, 2025
2 checks passed
coderabbitai bot added a commit that referenced this pull request Apr 1, 2025
Docstrings generation was requested by @magicprinc.

* #1 (comment)

The following files were modified:

* `src/jmh/java/com/trivago/kangaroo/AbstractBenchHelper.java`
* `src/jmh/java/com/trivago/kangaroo/AbstractCommonBenchHelper.java`
* `src/jmh/java/com/trivago/kangaroo/FastutilWrapperBusyWaitingBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/FastutilWrapperDefaultBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/JavaUtilWrapperBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/long2long/AbstractLongLongBenchHelper.java`
* `src/jmh/java/com/trivago/kangaroo/long2long/FastutilWrapperBusyWaitingLongLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/long2long/FastutilWrapperDefaultLongLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/long2long/JavaConcurrentLongLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/long2long/JavaUtilWrapperLongLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/AbstractObjectLongBenchHelper.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/FastutilWrapperBusyWaitingObjectLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/FastutilWrapperDefaultObjectLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/JavaConcurrentObjectLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/JavaUtilWrapperObjectLongBenchmark.java`
* `src/jmh/java/com/trivago/kangaroo/object2long/TestObjectKey.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/PrimitiveConcurrentMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentBusyWaitingIntFloatMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentBusyWaitingIntIntMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentIntFloatMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/intkey/ConcurrentIntIntMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongFloatMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongIntMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongLongMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentBusyWaitingLongObjectMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongFloatMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongIntMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongLongMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/longkey/ConcurrentLongObjectMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentBusyWaitingObjectLongMap.java`
* `src/main/java/com/trivago/fastutilconcurrentwrapper/objkey/ConcurrentObjectLongMap.java`
Copy link

coderabbitai bot commented Apr 1, 2025

Note

Generated docstrings for this pull request at #2

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.

1 participant