Skip to content

[CORE] Return unmodifiable Set from ConsistentHash.getPartition()#11823

Draft
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/conHash
Draft

[CORE] Return unmodifiable Set from ConsistentHash.getPartition()#11823
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/conHash

Conversation

@acvictor
Copy link
Contributor

What changes are proposed in this pull request?

ConsistentHash is annotated with @ThreadSafe and guards all access with a ReadWriteLock but getPartition() returns a direct reference to the internal mutable HashSet. This PR wraps the returned set with Collections.unmodifiableSet() similar to getNodes() which already returns a copy.

How was this patch tested?

Existing UTs

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the CORE works for Gluten Core label Mar 25, 2026
@github-actions
Copy link

Run Gluten Clickhouse CI on x86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant