Skip to content

Commit

Permalink
Polishing #1359
Browse files Browse the repository at this point in the history
Add final keyword where possible. Remove unused code.
  • Loading branch information
mp911de committed Jul 29, 2020
1 parent 7d7c79b commit 36e31f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions src/main/java/io/lettuce/core/cluster/PartitionAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ List<RedisClusterNode> getMasters() {
return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.MASTER));
}

List<RedisClusterNode> getReplicas() {
return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE));

}

List<RedisClusterNode> getReplicas(RedisClusterNode master) {
return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE)
&& master.getNodeId().equals(redisClusterNode.getSlaveOf()));
}

List<RedisClusterNode> getReadCandidates(RedisClusterNode master) {
return get(redisClusterNode -> redisClusterNode.getNodeId().equals(master.getNodeId())
|| (redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
*/
public class AdaptiveRefreshTriggeredEvent implements Event {

private Supplier<Partitions> partitionsSupplier;
private final Supplier<Partitions> partitionsSupplier;

private Runnable topologyRefreshScheduler;
private final Runnable topologyRefreshScheduler;

public AdaptiveRefreshTriggeredEvent(Supplier<Partitions> partitionsSupplier, Runnable topologyRefreshScheduler) {
this.partitionsSupplier = partitionsSupplier;
Expand Down

0 comments on commit 36e31f3

Please sign in to comment.