cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aweisberg <...@git.apache.org>
Subject [GitHub] cassandra pull request #224: 14405 replicas
Date Wed, 16 May 2018 17:06:10 GMT
Github user aweisberg commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/224#discussion_r188685170
  
    --- Diff: src/java/org/apache/cassandra/service/StorageService.java ---
    @@ -3863,17 +3863,12 @@ public void forceTerminateAllRepairSessions()
          *
          * @param keyspace keyspace name also known as keyspace
          * @param pos position for which we need to find the endpoint
    -     * @param liveEps the list of endpoints to mutate
          */
    -    public void getLiveNaturalEndpoints(Keyspace keyspace, RingPosition pos, List<InetAddressAndPort>
liveEps)
    +    public ReplicaList getLiveNaturalReplicas(Keyspace keyspace, RingPosition pos)
         {
    -        List<InetAddressAndPort> endpoints = keyspace.getReplicationStrategy().getNaturalEndpoints(pos);
    +        ReplicaList replicas = keyspace.getReplicationStrategy().getNaturalReplicas(pos);
     
    -        for (InetAddressAndPort endpoint : endpoints)
    -        {
    -            if (FailureDetector.instance.isAlive(endpoint))
    -                liveEps.add(endpoint);
    -        }
    +        return replicas.filter(r -> FailureDetector.instance.isAlive(r.getEndpoint()));
    --- End diff --
    
    if isAlive were static you wouldn't have to allocate lambda here.


---

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


Mime
View raw message