public class RepairSession extends AsyncFuture<RepairSessionResult> implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener, LocalSessions.Listener
RepairJob
that handles the repair of that CF.
A given RepairJob has the 3 main phases:
ValidationTask
) and waits until all trees are received (in
validationComplete()).
SyncTask
.
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable
Modifier and Type | Field and Description |
---|---|
boolean |
isIncremental
Range to repair
|
boolean |
optimiseStreams |
RepairParallelism |
parallelismDegree |
boolean |
paxosOnly |
PreviewKind |
previewKind |
boolean |
pullRepair |
boolean |
repairPaxos |
SessionState |
state |
ExecutorPlus |
taskExecutor |
Scheduler |
validationScheduler |
CANCELLED, UNCANCELLABLE, UNSET
Constructor and Description |
---|
RepairSession(TimeUUID parentRepairSession,
Scheduler validationScheduler,
CommonRange commonRange,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isIncremental,
boolean pullRepair,
PreviewKind previewKind,
boolean optimiseStreams,
boolean repairPaxos,
boolean paxosOnly,
java.lang.String... cfnames)
Create new repair session.
|
Modifier and Type | Method and Description |
---|---|
void |
convict(InetAddressAndPort endpoint,
double phi)
Convict the specified endpoint.
|
protected ExecutorPlus |
createExecutor() |
java.util.Collection<InetAddressAndPort> |
endpoints() |
void |
forceShutdown(java.lang.Throwable reason)
clear all RepairJobs and terminate this session.
|
TimeUUID |
getId() |
void |
onIRStateChange(LocalSession session) |
void |
onRemove(InetAddressAndPort endpoint) |
void |
onRestart(InetAddressAndPort endpoint,
EndpointState epState)
Called whenever a node is restarted.
|
java.util.Collection<Range<Token>> |
ranges() |
void |
start(ExecutorPlus executor)
Start RepairJob on given ColumnFamilies.
|
void |
syncComplete(RepairJobDesc desc,
SyncNodePair nodes,
boolean success,
java.util.List<SessionSummary> summaries)
Notify this session that sync completed/failed with given
SyncNodePair . |
void |
terminate() |
void |
trackSyncCompletion(Pair<RepairJobDesc,SyncNodePair> key,
CompletableRemoteSyncTask task) |
void |
trackValidationCompletion(Pair<RepairJobDesc,InetAddressAndPort> key,
ValidationTask task) |
void |
validationComplete(RepairJobDesc desc,
InetAddressAndPort endpoint,
MerkleTrees trees)
Receive merkle tree response or failed response from
endpoint for current repair job. |
await, awaitUntil, flatMap, map
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
beforeChange, onAlive, onChange, onDead, onJoin
await, awaitUninterruptibly, flatMap, rethrowIfFailed, sync, syncThrowUncheckedOnInterrupt, syncUninterruptibly
public final SessionState state
public final RepairParallelism parallelismDegree
public final boolean pullRepair
public final boolean isIncremental
public final PreviewKind previewKind
public final boolean repairPaxos
public final boolean paxosOnly
public final ExecutorPlus taskExecutor
public final boolean optimiseStreams
public final Scheduler validationScheduler
public RepairSession(TimeUUID parentRepairSession, Scheduler validationScheduler, CommonRange commonRange, java.lang.String keyspace, RepairParallelism parallelismDegree, boolean isIncremental, boolean pullRepair, PreviewKind previewKind, boolean optimiseStreams, boolean repairPaxos, boolean paxosOnly, java.lang.String... cfnames)
parentRepairSession
- the parent sessions idcommonRange
- ranges to repairkeyspace
- name of keyspaceparallelismDegree
- specifies the degree of parallelism when calculating the merkle treespullRepair
- true if the repair should be one way (from remote host to this host and only applicable between two hosts--see RepairOption)repairPaxos
- true if incomplete paxos operations should be completed as part of repairpaxosOnly
- true if we should only complete paxos operations, not run a normal repaircfnames
- names of columnfamiliesprotected ExecutorPlus createExecutor()
public TimeUUID getId()
public java.util.Collection<InetAddressAndPort> endpoints()
public void trackValidationCompletion(Pair<RepairJobDesc,InetAddressAndPort> key, ValidationTask task)
public void trackSyncCompletion(Pair<RepairJobDesc,SyncNodePair> key, CompletableRemoteSyncTask task)
public void validationComplete(RepairJobDesc desc, InetAddressAndPort endpoint, MerkleTrees trees)
endpoint
for current repair job.desc
- repair job descriptionendpoint
- endpoint that sent merkle treetrees
- calculated merkle trees, or null if validation failedpublic void syncComplete(RepairJobDesc desc, SyncNodePair nodes, boolean success, java.util.List<SessionSummary> summaries)
SyncNodePair
.desc
- synced repair jobnodes
- nodes that completed syncsuccess
- true if sync succeededpublic void start(ExecutorPlus executor)
executor
- Executor to run validationpublic void terminate()
public void forceShutdown(java.lang.Throwable reason)
reason
- Cause of error for shutdownpublic void onRemove(InetAddressAndPort endpoint)
onRemove
in interface IEndpointStateChangeSubscriber
public void onRestart(InetAddressAndPort endpoint, EndpointState epState)
IEndpointStateChangeSubscriber
state.isAlive() == false
as state
is from before the restarted node is marked up.onRestart
in interface IEndpointStateChangeSubscriber
public void convict(InetAddressAndPort endpoint, double phi)
IFailureDetectionEventListener
convict
in interface IFailureDetectionEventListener
endpoint
- endpoint to be convictedphi
- the value of phi with with ep was convictedpublic void onIRStateChange(LocalSession session)
onIRStateChange
in interface LocalSessions.Listener
Copyright © 2009- The Apache Software Foundation