Mp 11740 introduce sorted map to fast utils wrapper#21
Merged
sarveswaran-m merged 11 commits intoApr 24, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a new LongShort primitive map API plus fastutil-backed implementations, including a sorted/tree variant supporting floorEntry() and concurrent wrappers/builders.
Changes:
- Added
LongShortMapandLongShortTreeMapinterfaces and primitive fastutil wrapper implementations. - Added concurrent (blocking + busy-waiting)
LongShortMapandLongShortTreeMapimplementations plus corresponding builders. - Added comprehensive JUnit tests for the new map types, including
floorEntry()correctness tests.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/trivago/fastutilconcurrentwrapper/LongShortMap.java | Introduces long -> short primitive map API. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/LongShortTreeMap.java | Adds sorted-map API extension with floorEntry(). |
| src/main/java/com/trivago/fastutilconcurrentwrapper/wrapper/PrimitiveFastutilLongShortWrapper.java | Fastutil Long2ShortOpenHashMap wrapper implementing LongShortMap. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/impl/longs/FloorableLongShortAVLTreeMap.java | Adds floorEntry() to fastutil AVL tree map via headMap(). |
| src/main/java/com/trivago/fastutilconcurrentwrapper/wrapper/PrimitiveFastutilLongShortTreeWrapper.java | Wraps FloorableLongShortAVLTreeMap to implement LongShortTreeMap. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/map/ConcurrentLongShortMap.java | Blocking concurrent bucketed LongShortMap wrapper. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/map/ConcurrentBusyWaitingLongShortMap.java | Busy-waiting concurrent bucketed LongShortMap wrapper. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/map/ConcurrentLongShortTreeMap.java | Blocking concurrent wrapper for LongShortTreeMap. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/map/ConcurrentBusyWaitingLongShortTreeMap.java | Busy-waiting concurrent wrapper for LongShortTreeMap. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongShortMapBuilder.java | Builder for concurrent LongShortMap variants. |
| src/main/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongShortTreeMapBuilder.java | Builder for concurrent LongShortTreeMap variants. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/AbstractMapTest.java | Adds nextShort() helper for new tests. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/AbstractLongShortMapTest.java | Base contract tests for LongShortMap. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/AbstractLongShortTreeMapTest.java | Base contract tests for LongShortTreeMap incl. floorEntry(). |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/PrimitiveFastutilLongShortWrapperTest.java | Runs LongShortMap contract against primitive fastutil wrapper. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/PrimitiveFastutilLongShortTreeWrapperTest.java | Runs LongShortTreeMap contract against primitive tree wrapper. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/ConcurrentPrimitiveLongShortMapTest.java | Runs LongShortMap contract against blocking concurrent map. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/ConcurrentBusyWaitingLongShortMapTest.java | Runs LongShortMap contract against busy-waiting concurrent map. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/ConcurrentPrimitiveLongShortTreeMapTest.java | Runs LongShortTreeMap contract against blocking concurrent tree map. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/ConcurrentBusyWaitingLongShortTreeMapTest.java | Runs LongShortTreeMap contract against busy-waiting concurrent tree map. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/longshort/FloorEntryCorrectnessTest.java | Adds targeted correctness suite for floorEntry() implementation. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongShortMapBuilderTest.java | Verifies ConcurrentLongShortMapBuilder builds correct variants. |
| src/test/java/com/trivago/fastutilconcurrentwrapper/ConcurrentLongShortTreeMapBuilderTest.java | Verifies ConcurrentLongShortTreeMapBuilder builds correct variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/trivago/fastutil-concurrent-wrapper/sessions/06e81fc3-7af9-46a9-9a6e-9afec03ed2d1 Co-authored-by: sarveswaran-m <34768285+sarveswaran-m@users.noreply.github.com>
The-E
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
headMap()to realizefloorEntry()floorEntry()