Skip to content
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

Add hasSameSlotsOf method to RedisClusterNode for a quick slots comparison #1013

Conversation

alessandrosimi-sa
Copy link
Contributor

This PR is related to the issue #1011.

What

Added the hasSameSlotsOf method to the RedisClusterNode class so it can be used by the TopologyComparators class while is comparing the node slots.
Added unit tests to verify the behaviour of the new method.

Why
Solve the performance issue #1011

@codecov
Copy link

codecov bot commented Apr 10, 2019

Codecov Report

Merging #1013 into master will decrease coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1013      +/-   ##
============================================
- Coverage     80.89%   80.52%   -0.38%     
+ Complexity     5794     5754      -40     
============================================
  Files           416      416              
  Lines         18984    18986       +2     
  Branches       2194     2194              
============================================
- Hits          15358    15288      -70     
- Misses         2587     2663      +76     
+ Partials       1039     1035       -4
Impacted Files Coverage Δ Complexity Δ
...uce/core/cluster/topology/TopologyComparators.java 87.87% <100%> (+1.01%) 21 <0> (ø) ⬇️
...re/cluster/models/partitions/RedisClusterNode.java 95.68% <100%> (+0.07%) 49 <2> (+2) ⬆️
...re/cluster/StatefulRedisClusterConnectionImpl.java 55.68% <0%> (-32.96%) 24% <0%> (-12%)
...va/io/lettuce/core/cluster/RedisClusterClient.java 77.7% <0%> (-5.58%) 103% <0%> (-11%)
...cluster/RedisAdvancedClusterAsyncCommandsImpl.java 83.03% <0%> (-2.68%) 85% <0%> (-3%)
...core/cluster/ClusterDistributionChannelWriter.java 76.06% <0%> (-2.66%) 50% <0%> (-2%)
...va/io/lettuce/core/AbstractRedisAsyncCommands.java 95.23% <0%> (-2.05%) 396% <0%> (-9%)
.../core/cluster/topology/ClusterTopologyRefresh.java 79.36% <0%> (-1.59%) 31% <0%> (ø)
.../io/lettuce/core/dynamic/ReactiveTypeAdapters.java 83.78% <0%> (-1.36%) 1% <0%> (ø)
...main/java/io/lettuce/core/RedisChannelHandler.java 73.83% <0%> (-0.94%) 31% <0%> (-2%)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25d0669...f90f330. Read the comment docs.

mp911de pushed a commit that referenced this pull request Apr 11, 2019
We now use BitSet.equals() to compare slot sets of RedisClusterNode for an improved comparison performance.

Original pull request: #1013.
mp911de added a commit that referenced this pull request Apr 11, 2019
Refactor nullability check as RedisClusterNode is expected to be never null. Add author tags.

Original pull request: #1013
mp911de pushed a commit that referenced this pull request Apr 11, 2019
We now use BitSet.equals() to compare slot sets of RedisClusterNode for an improved comparison performance.

Original pull request: #1013.
mp911de added a commit that referenced this pull request Apr 11, 2019
Refactor nullability check as RedisClusterNode is expected to be never null. Add author tags.

Original pull request: #1013
@mp911de mp911de added this to the 5.1.7 milestone Apr 11, 2019
@mp911de mp911de added the type: feature A new feature label Apr 11, 2019
@mp911de
Copy link
Collaborator

mp911de commented Apr 11, 2019

Thanks a lot. That's merged, polished, and backported now.

@mp911de mp911de closed this Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants