Class NoopReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
- java.lang.Object
-
- org.apache.cassandra.service.reads.repair.NoopReadRepair<E,P>
-
- All Implemented Interfaces:
ReadRepair<E,P>
public class NoopReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>> extends java.lang.Object implements ReadRepair<E,P>
Bypasses the read repair path for short read protection and testing
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.service.reads.repair.ReadRepair
ReadRepair.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static NoopReadRepairinstance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitReads()Block on the reads (or timeout) sent out inReadRepair.startRepair(org.apache.cassandra.service.reads.DigestResolver<E, P>, java.util.function.Consumer<org.apache.cassandra.db.partitions.PartitionIterator>)voidawaitWrites()Block on any mutations (or timeout) we sent out to repair replicas inReadRepair.repairPartition(org.apache.cassandra.db.DecoratedKey, java.util.Map<org.apache.cassandra.locator.Replica, org.apache.cassandra.db.Mutation>, org.apache.cassandra.locator.ReplicaPlan.ForWrite)UnfilteredPartitionIterators.MergeListenergetMergeListener(P replicas)Used by DataResolver to generate corrections as the partition iterator is consumedvoidmaybeSendAdditionalReads()if it looks like we might not receive data requests from everyone in time, send additional requests to additional replicas not contacted in the initial full data read.voidmaybeSendAdditionalWrites()If it looks like we might not receive acks for all the repair mutations we sent out, combine all the unacked mutations and send them to the minority of nodes not involved in the read repair data read / write cycle.voidrepairPartition(DecoratedKey partitionKey, java.util.Map<Replica,Mutation> mutations, ReplicaPlan.ForWrite writePlan)Repairs a partition _after_ receiving data responses.voidstartRepair(DigestResolver<E,P> digestResolver, java.util.function.Consumer<PartitionIterator> resultConsumer)Called when the digests from the initial read don't match.
-
-
-
Field Detail
-
instance
public static final NoopReadRepair instance
-
-
Method Detail
-
getMergeListener
public UnfilteredPartitionIterators.MergeListener getMergeListener(P replicas)
Description copied from interface:ReadRepairUsed by DataResolver to generate corrections as the partition iterator is consumed- Specified by:
getMergeListenerin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
-
startRepair
public void startRepair(DigestResolver<E,P> digestResolver, java.util.function.Consumer<PartitionIterator> resultConsumer)
Description copied from interface:ReadRepairCalled when the digests from the initial read don't match. Reads may block on the repair started by this method.- Specified by:
startRepairin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>- Parameters:
digestResolver- supplied so we can get the original data responseresultConsumer- hook for the repair to set it's result on completion
-
awaitReads
public void awaitReads() throws ReadTimeoutExceptionDescription copied from interface:ReadRepairBlock on the reads (or timeout) sent out inReadRepair.startRepair(org.apache.cassandra.service.reads.DigestResolver<E, P>, java.util.function.Consumer<org.apache.cassandra.db.partitions.PartitionIterator>)- Specified by:
awaitReadsin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>- Throws:
ReadTimeoutException
-
maybeSendAdditionalReads
public void maybeSendAdditionalReads()
Description copied from interface:ReadRepairif it looks like we might not receive data requests from everyone in time, send additional requests to additional replicas not contacted in the initial full data read. If the collection of nodes that end up responding in time end up agreeing on the data, and we don't consider the response from the disagreeing replica that triggered the read repair, that's ok, since the disagreeing data would not have been successfully written and won't be included in the response the the client, preserving the expectation of monotonic quorum reads- Specified by:
maybeSendAdditionalReadsin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
-
maybeSendAdditionalWrites
public void maybeSendAdditionalWrites()
Description copied from interface:ReadRepairIf it looks like we might not receive acks for all the repair mutations we sent out, combine all the unacked mutations and send them to the minority of nodes not involved in the read repair data read / write cycle. We will accept acks from them in lieu of acks from the initial mutations sent out, so long as we receive the same number of acks as repair mutations transmitted. This prevents misbehaving nodes from killing a quorum read, while continuing to guarantee monotonic quorum reads- Specified by:
maybeSendAdditionalWritesin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
-
awaitWrites
public void awaitWrites()
Description copied from interface:ReadRepairBlock on any mutations (or timeout) we sent out to repair replicas inReadRepair.repairPartition(org.apache.cassandra.db.DecoratedKey, java.util.Map<org.apache.cassandra.locator.Replica, org.apache.cassandra.db.Mutation>, org.apache.cassandra.locator.ReplicaPlan.ForWrite)- Specified by:
awaitWritesin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
-
repairPartition
public void repairPartition(DecoratedKey partitionKey, java.util.Map<Replica,Mutation> mutations, ReplicaPlan.ForWrite writePlan)
Description copied from interface:ReadRepairRepairs a partition _after_ receiving data responses. This method receives replica list, since we will block repair only on the replicas that have responded.- Specified by:
repairPartitionin interfaceReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
-
-