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. If there is difference between 2 trees, the
concerned SyncTask will start a streaming of the difference between the 2 endpoint concerned.
| Modifier and Type | Field and Description |
|---|---|
java.util.Set<java.net.InetAddress> |
endpoints |
java.lang.String |
keyspace |
RepairParallelism |
parallelismDegree |
java.util.UUID |
parentRepairSession |
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,
java.lang.String... cfnames)
Create new repair session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beforeChange(java.net.InetAddress endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue) |
void |
convict(java.net.InetAddress endpoint,
double phi)
Convict the specified endpoint.
|
void |
forceShutdown(java.lang.Throwable reason)
clear all RepairJobs and terminate this session.
|
java.util.UUID |
getId() |
java.util.Collection<Range<Token>> |
getRanges() |
void |
onAlive(java.net.InetAddress endpoint,
EndpointState state) |
void |
onChange(java.net.InetAddress endpoint,
ApplicationState state,
VersionedValue value) |
void |
onDead(java.net.InetAddress endpoint,
EndpointState state) |
void |
onJoin(java.net.InetAddress endpoint,
EndpointState epState)
Use to inform interested parties about the change in the state
for specified endpoint
|
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) |
public final java.util.UUID parentRepairSession
public final java.lang.String keyspace
public final RepairParallelism parallelismDegree
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,
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)cfnames - names of columnfamiliespublic 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 onJoin(java.net.InetAddress endpoint,
EndpointState epState)
IEndpointStateChangeSubscriberonJoin in interface IEndpointStateChangeSubscriberendpoint - endpoint for which the state change occurred.epState - state that actually changed for the above endpoint.public void beforeChange(java.net.InetAddress endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue)
beforeChange in interface IEndpointStateChangeSubscriberpublic void onChange(java.net.InetAddress endpoint,
ApplicationState state,
VersionedValue value)
onChange in interface IEndpointStateChangeSubscriberpublic void onAlive(java.net.InetAddress endpoint,
EndpointState state)
onAlive in interface IEndpointStateChangeSubscriberpublic void onDead(java.net.InetAddress endpoint,
EndpointState state)
onDead in interface IEndpointStateChangeSubscriberpublic 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 © 2016 The Apache Software Foundation