Class AbstractReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
java.lang.Object
org.apache.cassandra.service.reads.repair.AbstractReadRepair<E,P>
- All Implemented Interfaces:
ReadRepair<E,P>
- Direct Known Subclasses:
BlockingReadRepair,ReadOnlyReadRepair
public abstract class AbstractReadRepair<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E,P>>
extends Object
implements ReadRepair<E,P>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.service.reads.repair.ReadRepair
ReadRepair.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColumnFamilyStoreprotected final ReadCommandprotected static final org.slf4j.Loggerprotected final ReplicaPlan.Shared<E,P> protected final Dispatcher.RequestTime -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReadRepair(ReadCommand command, ReplicaPlan.Shared<E, P> replicaPlan, Dispatcher.RequestTime requestTime) -
Method Summary
Modifier and TypeMethodDescriptionvoidBlock 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>)voidif 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.protected PvoidstartRepair(DigestResolver<E, P> digestResolver, Consumer<PartitionIterator> resultConsumer) Called when the digests from the initial read don't match.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.service.reads.repair.ReadRepair
awaitWrites, getMergeListener, maybeSendAdditionalWrites, repairPartition
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
command
-
requestTime
-
replicaPlan
protected final ReplicaPlan.Shared<E extends Endpoints<E>,P extends ReplicaPlan.ForRead<E, replicaPlanP>> -
cfs
-
-
Constructor Details
-
Method Details
-
replicaPlan
-
startRepair
public void startRepair(DigestResolver<E, P> digestResolver, 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
Description 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>>
-