Github user ifesdjeen commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/224#discussion_r197156136
  
    --- 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();
     
                     logger.debug("Calculating ranges to stream and request for 
keyspace {}", keyspace);
                     for (Token newToken : newTokens)
                     {
                         // getting collection of the currently used ranges by 
this keyspace
    -                    Collection<Range<Token>> currentRanges = 
endpointToRanges.get(localAddress);
    +                    ReplicaSet currentReplicas = 
endpointToRanges.get(localAddress);
    --- End diff --
    
    `currentReplicas` is used inside the loop only. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to