public class RepairSession extends com.google.common.util.concurrent.AbstractFuture<RepairSessionResult> implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener
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 for each diverging replica. If there are differences
between 2 trees, the concerned SyncTask stream the differences between the 2 endpoints concerned.
| Modifier and Type | Field and Description |
|---|---|
java.util.Set<java.net.InetAddress> |
endpoints |
java.lang.String |
keyspace |
RepairParallelism |
parallelismDegree |
java.util.UUID |
parentRepairSession |
boolean |
pullRepair |
java.util.Collection<Range<Token>> |
ranges
Range to repair
|
long |
repairedAt |
com.google.common.util.concurrent.ListeningExecutorService |
taskExecutor |
| Constructor and Description |
|---|
RepairSession(java.util.UUID parentRepairSession,
java.util.UUID id,
java.util.Collection<Range<Token>> ranges,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
long repairedAt,
boolean pullRepair,
java.lang.String... cfnames)
Create new repair session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
convict(java.net.InetAddress endpoint,
double phi)
Convict the specified endpoint.
|
protected DebuggableThreadPoolExecutor |
createExecutor() |
void |
forceShutdown(java.lang.Throwable reason)
clear all RepairJobs and terminate this session.
|
java.util.UUID |
getId() |
java.util.Collection<Range<Token>> |
getRanges() |
void |
onRemove(java.net.InetAddress endpoint) |
void |
onRestart(java.net.InetAddress endpoint,
EndpointState epState)
Called whenever a node is restarted.
|
void |
start(com.google.common.util.concurrent.ListeningExecutorService executor)
Start RepairJob on given ColumnFamilies.
|
void |
syncComplete(RepairJobDesc desc,
NodePair nodes,
boolean success)
Notify this session that sync completed/failed with given
NodePair. |
void |
terminate() |
void |
validationComplete(RepairJobDesc desc,
java.net.InetAddress endpoint,
MerkleTrees trees)
Receive merkle tree response or failed response from
endpoint for current repair job. |
void |
waitForSync(Pair<RepairJobDesc,NodePair> key,
RemoteSyncTask task) |
void |
waitForValidation(Pair<RepairJobDesc,java.net.InetAddress> key,
ValidationTask task) |
addListener, cancel, get, get, interruptTask, isCancelled, isDone, set, setException, wasInterruptedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeforeChange, onAlive, onChange, onDead, onJoinpublic final java.util.UUID parentRepairSession
public final java.lang.String keyspace
public final RepairParallelism parallelismDegree
public final boolean pullRepair
public final java.util.Set<java.net.InetAddress> endpoints
public final long repairedAt
public final com.google.common.util.concurrent.ListeningExecutorService taskExecutor
public RepairSession(java.util.UUID parentRepairSession,
java.util.UUID id,
java.util.Collection<Range<Token>> ranges,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
long repairedAt,
boolean pullRepair,
java.lang.String... cfnames)
parentRepairSession - the parent sessions idid - this sessions idranges - ranges to repairkeyspace - name of keyspaceparallelismDegree - specifies the degree of parallelism when calculating the merkle treesendpoints - the data centers that should be part of the repair; null for all DCsrepairedAt - when the repair occurred (millis)pullRepair - 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 void waitForValidation(Pair<RepairJobDesc,java.net.InetAddress> key, ValidationTask task)
public void waitForSync(Pair<RepairJobDesc,NodePair> key, RemoteSyncTask task)
public void validationComplete(RepairJobDesc desc, java.net.InetAddress 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, NodePair nodes, boolean success)
NodePair.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(java.net.InetAddress endpoint)
onRemove in interface IEndpointStateChangeSubscriberpublic void onRestart(java.net.InetAddress endpoint,
EndpointState epState)
IEndpointStateChangeSubscriberstate.isAlive() == false
as state is from before the restarted node is marked up.onRestart in interface IEndpointStateChangeSubscriberpublic void convict(java.net.InetAddress endpoint,
double phi)
IFailureDetectionEventListenerconvict in interface IFailureDetectionEventListenerendpoint - endpoint to be convictedphi - the value of phi with with ep was convictedCopyright © 2009-2022 The Apache Software Foundation