public class RepairSession extends WrappedRunnable implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener, IRepairJobEventListener
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.locks.Condition |
differencingDone |
java.util.Set<java.net.InetAddress> |
endpoints |
java.lang.String |
keyspace |
RepairParallelism |
parallelismDegree |
java.util.UUID |
parentRepairSession |
Range<Token> |
range
Range to repair
|
Constructor and Description |
---|
RepairSession(java.util.UUID parentRepairSession,
Range<Token> range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
java.lang.String... cfnames)
Create new repair session.
|
RepairSession(java.util.UUID parentRepairSession,
java.util.UUID id,
Range<Token> range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
java.lang.String[] cfnames) |
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 |
failedSnapshot()
Signal that there was a failure during the snapshot creation process.
|
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 RepairParallelism parallelismDegree
public final java.util.Set<java.net.InetAddress> endpoints
public final java.util.concurrent.locks.Condition differencingDone
public final java.util.UUID parentRepairSession
public RepairSession(java.util.UUID parentRepairSession, Range<Token> range, java.lang.String keyspace, RepairParallelism parallelismDegree, java.util.Set<java.net.InetAddress> endpoints, java.lang.String... cfnames)
range
- range 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 DCscfnames
- names of columnfamiliespublic RepairSession(java.util.UUID parentRepairSession, java.util.UUID id, Range<Token> range, java.lang.String keyspace, RepairParallelism parallelismDegree, java.util.Set<java.net.InetAddress> endpoints, java.lang.String[] cfnames)
public 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 failedSnapshot()
IRepairJobEventListener
failedSnapshot
in interface IRepairJobEventListener
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 beforeChange(java.net.InetAddress endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue)
beforeChange
in interface IEndpointStateChangeSubscriber
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 © 2017 The Apache Software Foundation