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