Github user ifesdjeen commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/224#discussion_r197156422
--- Diff: src/java/org/apache/cassandra/service/StorageService.java ---
@@ -4231,53 +4211,53 @@ private void
calculateToFromStreams(Collection<Token> newTokens, List<String> ke
InetAddressAndPort localAddress =
FBUtilities.getBroadcastAddressAndPort();
IEndpointSnitch snitch =
DatabaseDescriptor.getEndpointSnitch();
TokenMetadata tokenMetaCloneAllSettled =
tokenMetadata.cloneAfterAllSettled();
- // clone to avoid concurrent modification in
calculateNaturalEndpoints
+ // clone to avoid concurrent modification in
calculateNaturalReplicas
TokenMetadata tokenMetaClone =
tokenMetadata.cloneOnlyTokenMap();
for (String keyspace : keyspaceNames)
{
// replication strategy of the current keyspace
AbstractReplicationStrategy strategy =
Keyspace.open(keyspace).getReplicationStrategy();
- Multimap<InetAddressAndPort, Range<Token>>
endpointToRanges = strategy.getAddressRanges();
+ ReplicaMultimap<InetAddressAndPort, ReplicaSet>
endpointToRanges = strategy.getAddressReplicas();
--- End diff --
add `getAddressReplicas` by `InetAddressAndPort` to avoid materialising map.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]