public class RepairSession extends com.google.common.util.concurrent.AbstractFuture<RepairSessionResult> implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener, LocalSessions.Listener
RepairJob
that handles the repair of that CF.
A given RepairJob has the 2 main phases:
ValidationTask
) and waits until all trees are received (in
validationComplete()).
SyncTask
.
Modifier and Type | Field and Description |
---|---|
CommonRange |
commonRange
Range to repair
|
boolean |
isIncremental |
java.lang.String |
keyspace |
boolean |
optimiseStreams |
RepairParallelism |
parallelismDegree |
java.util.UUID |
parentRepairSession |
PreviewKind |
previewKind |
boolean |
pullRepair |
com.google.common.util.concurrent.ListeningExecutorService |
taskExecutor |
Constructor and Description |
---|
RepairSession(java.util.UUID parentRepairSession,
java.util.UUID id,
CommonRange commonRange,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isIncremental,
boolean pullRepair,
PreviewKind previewKind,
boolean optimiseStreams,
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 DebuggableThreadPoolExecutor |
createExecutor() |
java.util.Collection<InetAddressAndPort> |
endpoints() |
void |
forceShutdown(java.lang.Throwable reason)
clear all RepairJobs and terminate this session.
|
java.util.UUID |
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(com.google.common.util.concurrent.ListeningExecutorService 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. |
addListener, afterDone, cancel, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
beforeChange, onAlive, onChange, onDead, onJoin
public final java.util.UUID parentRepairSession
public final java.lang.String keyspace
public final RepairParallelism parallelismDegree
public final boolean pullRepair
public final CommonRange commonRange
public final boolean isIncremental
public final PreviewKind previewKind
public final com.google.common.util.concurrent.ListeningExecutorService taskExecutor
public final boolean optimiseStreams
public RepairSession(java.util.UUID parentRepairSession, java.util.UUID id, CommonRange commonRange, java.lang.String keyspace, RepairParallelism parallelismDegree, boolean isIncremental, boolean pullRepair, PreviewKind previewKind, boolean optimiseStreams, java.lang.String... cfnames)
parentRepairSession
- the parent sessions idid
- this 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)cfnames
- names of columnfamiliesprotected DebuggableThreadPoolExecutor createExecutor()
public java.util.UUID 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(com.google.common.util.concurrent.ListeningExecutorService 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-2022 The Apache Software Foundation