Skip to content

Mp 11740 introduce sorted map to fast utils wrapper#21

Merged
sarveswaran-m merged 11 commits into
masterfrom
MP-11740-Introduce-sorted-map-to-fast-utils-wrapper
Apr 24, 2026
Merged

Mp 11740 introduce sorted map to fast utils wrapper#21
sarveswaran-m merged 11 commits into
masterfrom
MP-11740-Introduce-sorted-map-to-fast-utils-wrapper

Conversation

@sarveswaran-m
Copy link
Copy Markdown
Contributor

  • Introduces TreeMap that uses headMap() to realize floorEntry()
  • Bucketing avoided for correct behavior of floorEntry()

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 LongShortMap and LongShortTreeMap interfaces and primitive fastutil wrapper implementations.
  • Added concurrent (blocking + busy-waiting) LongShortMap and LongShortTreeMap implementations 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.

sarveswaran-m and others added 4 commits April 24, 2026 11:39
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>
@sarveswaran-m sarveswaran-m merged commit 9c6e785 into master Apr 24, 2026
2 checks passed
@sarveswaran-m sarveswaran-m deleted the MP-11740-Introduce-sorted-map-to-fast-utils-wrapper branch April 24, 2026 13:56
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.

4 participants