cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From belliottsmith <...@git.apache.org>
Subject [GitHub] cassandra pull request #269: Review tr range movements
Date Tue, 18 Sep 2018 11:06:46 GMT
Github user belliottsmith commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/269#discussion_r218388108
  
    --- Diff: src/java/org/apache/cassandra/dht/StreamStateStore.java ---
    @@ -54,8 +56,10 @@ public RangesAtEndpoint getAvailableRanges(String keyspace, IPartitioner
partiti
         @VisibleForTesting
         public boolean isDataAvailable(String keyspace, Token token)
         {
    -        RangesAtEndpoint availableRanges = getAvailableRanges(keyspace, token.getPartitioner());
    -        return availableRanges.ranges().stream().anyMatch(range -> range.contains(token));
    +        Pair<Set<Range<Token>>, Set<Range<Token>>> availableRanges
= getAvailableRanges(keyspace, token.getPartitioner());
    +
    +        return Streams.concat(availableRanges.left.stream(),
    +                              availableRanges.right.stream()).anyMatch(range -> range.contains(token));
    --- End diff --
    
    It would be clearer IMO to have .anyMatch indent on the newline, preferably inline with
.concat() - I initially read this as only performing the anyMatch on right, and was trying
to figure out why


---

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


Mime
View raw message