public class RepairSession extends WrappedRunnable implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.locks.Condition |
differencingDone |
java.util.Set<java.net.InetAddress> |
endpoints |
boolean |
isSequential |
java.lang.String |
keyspace |
Range<Token> |
range
Range to repair
|
Constructor and Description |
---|
RepairSession(Range<Token> range,
java.lang.String keyspace,
boolean isSequential,
boolean isLocal,
java.lang.String... cfnames)
Create new repair session.
|
RepairSession(java.util.UUID id,
Range<Token> range,
java.lang.String keyspace,
boolean isSequential,
boolean isLocal,
java.lang.String[] cfnames) |
Modifier and Type | Method and Description |
---|---|
void |
convict(java.net.InetAddress endpoint,
double phi)
Convict the specified endpoint.
|
void |
forceShutdown()
clear all RepairJobs and terminate this session.
|
java.util.UUID |
getId() |
Range<Token> |
getRange() |
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 |
runMayThrow() |
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,
MerkleTree tree)
Receive merkle tree response or failed response from
endpoint for current repair job. |
run
public final java.lang.String keyspace
public final boolean isSequential
public final java.util.Set<java.net.InetAddress> endpoints
public final java.util.concurrent.locks.Condition differencingDone
public RepairSession(Range<Token> range, java.lang.String keyspace, boolean isSequential, boolean isLocal, java.lang.String... cfnames)
range
- range to repairkeyspace
- name of keyspaceisSequential
- true if performing repair on snapshots sequentiallyisLocal
- true if you want to perform repair only inside the data centercfnames
- names of columnfamiliespublic java.util.UUID getId()
public void validationComplete(RepairJobDesc desc, java.net.InetAddress endpoint, MerkleTree tree)
endpoint
for current repair job.desc
- repair job descriptionendpoint
- endpoint that sent merkle treetree
- calculated merkle tree, 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 runMayThrow() throws java.lang.Exception
runMayThrow
in class WrappedRunnable
java.lang.Exception
public void terminate()
public void forceShutdown()
public void onJoin(java.net.InetAddress endpoint, EndpointState epState)
IEndpointStateChangeSubscriber
onJoin
in interface IEndpointStateChangeSubscriber
endpoint
- endpoint for which the state change occurred.epState
- state that actually changed for the above endpoint.public void onChange(java.net.InetAddress endpoint, ApplicationState state, VersionedValue value)
onChange
in interface IEndpointStateChangeSubscriber
public void onAlive(java.net.InetAddress endpoint, EndpointState state)
onAlive
in interface IEndpointStateChangeSubscriber
public void onDead(java.net.InetAddress endpoint, EndpointState state)
onDead
in interface IEndpointStateChangeSubscriber
public void onRemove(java.net.InetAddress endpoint)
onRemove
in interface IEndpointStateChangeSubscriber
public void onRestart(java.net.InetAddress 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(java.net.InetAddress endpoint, double phi)
IFailureDetectionEventListener
convict
in interface IFailureDetectionEventListener
endpoint
- endpoint to be convictedphi
- the value of phi with with ep was convictedCopyright © 2013 The Apache Software Foundation