anderoo commented on code in PR #93:
URL: 
https://github.com/apache/cassandra-analytics/pull/93#discussion_r1863828560


##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/data/CassandraDataLayer.java:
##########
@@ -338,11 +338,13 @@ else if (clearSnapshotStrategy.hasTTL())
     private CompletionStage<Map<String, AvailabilityHint>> 
createSnapshot(ClientConfig options, RingResponse ring)
     {
         Map<String, PartitionedDataLayer.AvailabilityHint> availabilityHints = 
new ConcurrentHashMap<>(ring.size());
+        Map<String, Boolean> uniqueInstances = new ConcurrentHashMap<>();
 
         // Fire off create snapshot request across the entire cluster
         List<CompletableFuture<Void>> futures =
         ring.stream()
             .filter(ringEntry -> datacenter == null || 
datacenter.equals(ringEntry.datacenter()))
+            .filter(ringEntry -> uniqueInstances.putIfAbsent(ringEntry.fqdn(), 
true) == null)

Review Comment:
   To confirm, RingResponse comes from calling the keyspace specific ring 
endpoint on the sidecar, which returns an entry per token range rather than per 
instance.
   
   For a 6 node cluster with 4 num_tokens on each node:
   ```
   > curl -s $(hostname):7001/api/v1/cassandra/ring | jq '. | length'
   24
   > curl -s $(hostname):7001/api/v1/cassandra/ring | jq '. | 
group_by(.address) | length'
   6
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to