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

    https://github.com/apache/cassandra/pull/224#discussion_r197156892
  
    --- Diff: src/java/org/apache/cassandra/locator/TokenMetadata.java ---
    @@ -733,19 +733,19 @@ public InetAddressAndPort getEndpoint(Token token)
             return sortedTokens;
         }
     
    -    public Multimap<Range<Token>, InetAddressAndPort> 
getPendingRangesMM(String keyspaceName)
    +    public ReplicaMultimap<Range<Token>, ReplicaSet> 
getPendingRangesMM(String keyspaceName)
         {
    -        Multimap<Range<Token>, InetAddressAndPort> map = 
HashMultimap.create();
    +        ReplicaMultimap<Range<Token>, ReplicaSet> map = 
ReplicaMultimap.set();
             PendingRangeMaps pendingRangeMaps = 
this.pendingRanges.get(keyspaceName);
     
             if (pendingRangeMaps != null)
             {
    -            for (Map.Entry<Range<Token>, List<InetAddressAndPort>> entry : 
pendingRangeMaps)
    +            for (Map.Entry<Range<Token>, ReplicaList> entry : 
pendingRangeMaps)
                 {
                     Range<Token> range = entry.getKey();
    -                for (InetAddressAndPort address : entry.getValue())
    +                for (Replica replica : entry.getValue())
                     {
    -                    map.put(range, address);
    +                    map.put(range, replica);
    --- End diff --
    
    Since we're putting by `range` and iterating over `entry.getValue` here, it 
seems like we can spare this iteration.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to