Class BlockingPartitionRepair
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.AbstractFuture<V>
-
- org.apache.cassandra.utils.concurrent.AsyncFuture<java.lang.Object>
-
- org.apache.cassandra.service.reads.repair.BlockingPartitionRepair
-
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<java.lang.Object>
,io.netty.util.concurrent.Future<java.lang.Object>
,java.util.concurrent.Future<java.lang.Object>
,RequestCallback<java.lang.Object>
,Awaitable
,Future<java.lang.Object>
public class BlockingPartitionRepair extends AsyncFuture<java.lang.Object> implements RequestCallback<java.lang.Object>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
CANCELLED, UNCANCELLABLE, UNSET
-
-
Constructor Summary
Constructors Constructor Description BlockingPartitionRepair(DecoratedKey key, java.util.Map<Replica,Mutation> repairs, ReplicaPlan.ForWrite writePlan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitRepairsUntil(long timeoutAt, java.util.concurrent.TimeUnit timeUnit)
Wait for the repair to complete util a future time If the {@param timeoutAt} is a past time, the method returns immediately with the repair result.void
maybeSendAdditionalWrites(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
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.void
onResponse(Message<java.lang.Object> msg)
void
sendInitialRepairs()
protected void
sendRR(Message<Mutation> message, InetAddressAndPort endpoint)
-
Methods inherited from class org.apache.cassandra.utils.concurrent.AsyncFuture
await, awaitUntil, flatMap, map
-
Methods inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
addCallback, addCallback, addCallback, addCallback, addCallback, addCallback, addListener, addListener, addListener, addListeners, await, awaitThrowUncheckedOnInterrupt, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly, cancel, cause, description, flatMap, get, get, getNow, getWhenDone, isCancellable, isCancelled, isDone, isSuccess, isUncancellable, map, map, notifyExecutor, removeListener, removeListeners, setUncancellable, setUncancellableExclusive, toString, tryFailure, trySuccess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.utils.concurrent.Future
await, awaitUninterruptibly, flatMap, rethrowIfFailed, sync, syncThrowUncheckedOnInterrupt, syncUninterruptibly
-
Methods inherited from interface org.apache.cassandra.net.RequestCallback
invokeOnFailure, onFailure, trackLatencyForSnitch
-
-
-
-
Constructor Detail
-
BlockingPartitionRepair
public BlockingPartitionRepair(DecoratedKey key, java.util.Map<Replica,Mutation> repairs, ReplicaPlan.ForWrite writePlan)
-
-
Method Detail
-
onResponse
public void onResponse(Message<java.lang.Object> msg)
- Specified by:
onResponse
in interfaceRequestCallback<java.lang.Object>
- Parameters:
msg
- response received.
-
sendRR
protected void sendRR(Message<Mutation> message, InetAddressAndPort endpoint)
-
sendInitialRepairs
public void sendInitialRepairs()
-
awaitRepairsUntil
public boolean awaitRepairsUntil(long timeoutAt, java.util.concurrent.TimeUnit timeUnit)
Wait for the repair to complete util a future time If the {@param timeoutAt} is a past time, the method returns immediately with the repair result.- Parameters:
timeoutAt
- future timetimeUnit
- the time unit of the future time- Returns:
- true if repair is done; otherwise, false.
-
maybeSendAdditionalWrites
public void maybeSendAdditionalWrites(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
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. 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
-
-