arjunashok commented on code in PR #17:
URL:
https://github.com/apache/cassandra-analytics/pull/17#discussion_r1422019437
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/token/ConsistencyLevel.java:
##########
@@ -59,42 +87,34 @@ public boolean isLocal()
}
@Override
- public boolean checkConsistency(Collection<? extends
CassandraInstance> failedInsts,
- ReplicationFactor
replicationFactor,
+ public boolean checkConsistency(Set<String> writeReplicas,
+ Set<String> pendingReplicas,
+ Set<String> replacementInstances,
+ Set<String> blockedInstances,
+ Set<String> failedInstanceIps,
String localDC)
{
-
Preconditions.checkArgument(replicationFactor.getReplicationStrategy() !=
ReplicationFactor.ReplicationStrategy.SimpleStrategy,
- "EACH_QUORUM doesn't make sense
for SimpleStrategy keyspaces");
-
- for (String datacenter :
replicationFactor.getOptions().keySet())
- {
- int rf = replicationFactor.getOptions().get(datacenter);
- if (failedInsts.stream()
- .filter(instance ->
instance.getDataCenter().matches(datacenter))
- .count() > (rf - (rf / 2 + 1)))
- {
- return false;
- }
- }
-
- return true;
+ return (failedInstanceIps.size() + blockedInstances.size()) <=
(writeReplicas.size() - (writeReplicas.size() / 2 + 1));
Review Comment:
Correct, the idea was to keep this class confined to CL validation
--
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]