From 36e31f3dd9a2e8a95ff4f83e18ee9ee442a38e3a Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 29 Jul 2020 11:26:15 +0200 Subject: [PATCH] Polishing #1359 Add final keyword where possible. Remove unused code. --- .../io/lettuce/core/cluster/PartitionAccessor.java | 10 ---------- .../event/cluster/AdaptiveRefreshTriggeredEvent.java | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/lettuce/core/cluster/PartitionAccessor.java b/src/main/java/io/lettuce/core/cluster/PartitionAccessor.java index 57d2dc248e..43029cfe67 100644 --- a/src/main/java/io/lettuce/core/cluster/PartitionAccessor.java +++ b/src/main/java/io/lettuce/core/cluster/PartitionAccessor.java @@ -39,16 +39,6 @@ List getMasters() { return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.MASTER)); } - List getReplicas() { - return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE)); - - } - - List getReplicas(RedisClusterNode master) { - return get(redisClusterNode -> redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE) - && master.getNodeId().equals(redisClusterNode.getSlaveOf())); - } - List getReadCandidates(RedisClusterNode master) { return get(redisClusterNode -> redisClusterNode.getNodeId().equals(master.getNodeId()) || (redisClusterNode.is(RedisClusterNode.NodeFlag.SLAVE) diff --git a/src/main/java/io/lettuce/core/event/cluster/AdaptiveRefreshTriggeredEvent.java b/src/main/java/io/lettuce/core/event/cluster/AdaptiveRefreshTriggeredEvent.java index e9d719aee2..f75412b7a5 100644 --- a/src/main/java/io/lettuce/core/event/cluster/AdaptiveRefreshTriggeredEvent.java +++ b/src/main/java/io/lettuce/core/event/cluster/AdaptiveRefreshTriggeredEvent.java @@ -28,9 +28,9 @@ */ public class AdaptiveRefreshTriggeredEvent implements Event { - private Supplier partitionsSupplier; + private final Supplier partitionsSupplier; - private Runnable topologyRefreshScheduler; + private final Runnable topologyRefreshScheduler; public AdaptiveRefreshTriggeredEvent(Supplier partitionsSupplier, Runnable topologyRefreshScheduler) { this.partitionsSupplier = partitionsSupplier;