Skip to content

Improve default partition distribution for UUID keys - #3313

Open
yashdotdev13 wants to merge 1 commit into
spring-cloud:mainfrom
yashdotdev13:fix/3117-uuid-partition-distribution
Open

yashdotdev13 wants to merge 1 commit into
spring-cloud:mainfrom
yashdotdev13:fix/3117-uuid-partition-distribution

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Summary

Addresses #3117 by replacing the default partition selector's Object.hashCode() implementation with Murmur2 hashing.

Changes

  • Implement Murmur2 hashing in the default partition selector.
  • Convert keys to UTF-8 bytes before hashing.
  • Ensure the resulting hash is non-negative.
  • Add a regression test covering the distribution of 10,000 UUID-formatted keys across 16 partitions.

Testing

  • .\mvnw.cmd -pl core/spring-cloud-stream -Dtest=PartitionHandlerTests test — passed.
  • git diff --check — passed.

The module-wide Checkstyle command reported existing violations across the module.

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>

This branch has not been deployed

No deployments
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