Use cached partition topology for metrics/logs
This commit is contained in:
parent
f191c68efc
commit
51569ce0a5
|
@ -670,11 +670,10 @@ public class MessagesCache {
|
||||||
.thenRun(() -> sample.stop(clearQueueTimer));
|
.thenRun(() -> sample.stop(clearQueueTimer));
|
||||||
}
|
}
|
||||||
|
|
||||||
// expensive—use for rare error logging only
|
|
||||||
public String shardForSlot(int slot) {
|
public String shardForSlot(int slot) {
|
||||||
try {
|
try {
|
||||||
return redisCluster.withBinaryCluster(
|
return redisCluster.withBinaryCluster(
|
||||||
connection -> ClusterPartitionParser.parse(connection.sync().clusterNodes()).getPartitionBySlot(slot).getUri().getHost());
|
connection -> connection.getPartitions().getPartitionBySlot(slot).getUri().getHost());
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue