You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "jberragan (via GitHub)" <gi...@apache.org> on 2025/12/12 18:07:07 UTC

Re: [PR] CASSANALYTICS-101: Add EACH_QUORUM consistency level support in bulk reader [cassandra-analytics]

jberragan commented on code in PR #153:
URL: https://github.com/apache/cassandra-analytics/pull/153#discussion_r2615134537


##########
cassandra-analytics-common/src/main/java/org/apache/cassandra/spark/data/partitioner/ConsistencyLevel.java:
##########
@@ -63,6 +66,35 @@ private int localQuorumFor(@NotNull ReplicationFactor replicationFactor, @Nullab
                : quorumFor(replicationFactor);
     }
 
+    /**
+     * Calculates the number of replicas that must acknowledge the operation in each data center
+     * for EACH_QUORUM consistency level.
+     *
+     * @param replicationFactor the replication factor configuration containing data center information
+     * @return a map where keys are data center names and values are the number of replicas
+     * required to achieve local quorum in each data center
+     * @throws IllegalArgumentException if the consistency level is not EACH_QUORUM or if the
+     *                                  replication strategy is not NetworkTopologyStrategy
+     */
+    public Map<String, Integer> eachQuorumBlockFor(@NotNull ReplicationFactor replicationFactor)
+    {
+        if (this != EACH_QUORUM)
+        {
+            throw new IllegalArgumentException(String.format("Consistency level needed is EACH_QUORUM, provided is:%s",

Review Comment:
   nit: 
   
   ```suggestion
               throw new IllegalArgumentException(String.format("Consistency level needed is EACH_QUORUM, provided is: %s",
   ```



-- 
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