You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "yifan-c (via GitHub)" <gi...@apache.org> on 2024/09/05 06:59:05 UTC
Re: [PR] CASSANDRA-19873 Removes checks for blocked instances from bulk-write … [cassandra-analytics]
yifan-c commented on code in PR #76:
URL: https://github.com/apache/cassandra-analytics/pull/76#discussion_r1744906380
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/CassandraClusterInfo.java:
##########
@@ -406,22 +401,15 @@ private TokenRangeMapping<RingInstance> getTokenRangeReplicas()
.map(RingInstance::new)
.collect(Collectors.toSet());
- blockedInstances = response.replicaMetadata()
- .values()
- .stream()
- .map(RingInstance::new)
- .filter(this::instanceIsBlocked)
- .collect(Collectors.toSet());
-
- Set<String> blockedIps = blockedInstances.stream().map(i -> i.ringInstance().address())
- .collect(Collectors.toSet());
-
// Each token range has hosts by DC. We collate them across all ranges into all hosts by DC
writeReplicasByDC = response.writeReplicas()
.stream()
.flatMap(wr -> wr.replicasByDatacenter().entrySet().stream())
- .collect(Collectors.toMap(Map.Entry::getKey, e -> new HashSet<>(e.getValue()),
- (l1, l2) -> filterAndMergeInstances(l1, l2, blockedIps)));
+ .collect(Collectors.toMap(Map.Entry::getKey,
+ e -> new HashSet<>(e.getValue()), (l1, l2) -> {
+ l1.addAll(l2);
+ return l1;
+ }));
Review Comment:
Place the merge function in new line.
```suggestion
.collect(Collectors.toMap(Map.Entry::getKey,
e -> new HashSet<>(e.getValue()),
(l1, l2) -> {
l1.addAll(l2);
return l1;
}));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org