public class ActiveRepairService extends java.lang.Object implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener
Modifier and Type | Class and Description |
---|---|
static class |
ActiveRepairService.ParentRepairSession
We keep a ParentRepairSession around for the duration of the entire repair, for example, on a 256 token vnode rf=3 cluster
we would have 768 RepairSession but only one ParentRepairSession.
|
static class |
ActiveRepairService.Status |
Modifier and Type | Field and Description |
---|---|
static ActiveRepairService |
instance |
static long |
UNREPAIRED_SSTABLE |
Modifier | Constructor and Description |
---|---|
protected |
ActiveRepairService()
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addToActiveSessions(RepairSession session) |
void |
beforeChange(java.net.InetAddress endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue) |
void |
convict(java.net.InetAddress ep,
double phi)
Something has happened to a remote node - if that node is a coordinator, we mark the parent repair session id as failed.
|
java.util.Set<SSTableReader> |
currentlyRepairing(java.util.UUID cfId,
java.util.UUID parentRepairSession) |
com.google.common.util.concurrent.ListenableFuture<java.util.List<java.lang.Object>> |
doAntiCompaction(java.util.UUID parentRepairSession)
Submit anti-compaction jobs to CompactionManager.
|
com.google.common.util.concurrent.ListenableFuture<?> |
finishParentSession(java.util.UUID parentSession,
java.util.Set<java.net.InetAddress> neighbors,
boolean doAntiCompaction)
Run final process of repair.
|
static java.util.Set<java.net.InetAddress> |
getNeighbors(java.lang.String keyspaceName,
java.util.Collection<Range<Token>> keyspaceLocalRanges,
Range<Token> toRepair,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts)
Return all of the neighbors with whom we share the provided range.
|
ActiveRepairService.ParentRepairSession |
getParentRepairSession(java.util.UUID parentSessionId) |
void |
handleMessage(java.net.InetAddress endpoint,
RepairMessage message) |
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 state)
Called whenever a node is restarted.
|
java.util.UUID |
prepareForRepair(java.net.InetAddress coordinator,
java.util.Set<java.net.InetAddress> endpoints,
java.util.Collection<Range<Token>> ranges,
java.util.List<ColumnFamilyStore> columnFamilyStores) |
void |
registerParentRepairSession(java.util.UUID parentRepairSession,
java.net.InetAddress coordinator,
java.util.List<ColumnFamilyStore> columnFamilyStores,
java.util.Collection<Range<Token>> ranges) |
void |
removeFromActiveSessions(RepairSession session) |
ActiveRepairService.ParentRepairSession |
removeParentRepairSession(java.util.UUID parentSessionId) |
RepairFuture |
submitRepairSession(java.util.UUID parentRepairSession,
Range<Token> range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
java.lang.String... cfnames)
Requests repairs for the given keyspace and column families.
|
void |
terminateSessions() |
public static final ActiveRepairService instance
public static final long UNREPAIRED_SSTABLE
protected ActiveRepairService()
public RepairFuture submitRepairSession(java.util.UUID parentRepairSession, Range<Token> range, java.lang.String keyspace, RepairParallelism parallelismDegree, java.util.Set<java.net.InetAddress> endpoints, java.lang.String... cfnames)
public void addToActiveSessions(RepairSession session)
public void removeFromActiveSessions(RepairSession session)
public void terminateSessions()
public static java.util.Set<java.net.InetAddress> getNeighbors(java.lang.String keyspaceName, java.util.Collection<Range<Token>> keyspaceLocalRanges, Range<Token> toRepair, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts)
keyspaceName
- keyspace to repairkeyspaceLocalRanges
- local-range for given keyspaceNametoRepair
- token to repairdataCenters
- the data centers to involve in the repairpublic java.util.UUID prepareForRepair(java.net.InetAddress coordinator, java.util.Set<java.net.InetAddress> endpoints, java.util.Collection<Range<Token>> ranges, java.util.List<ColumnFamilyStore> columnFamilyStores)
public void registerParentRepairSession(java.util.UUID parentRepairSession, java.net.InetAddress coordinator, java.util.List<ColumnFamilyStore> columnFamilyStores, java.util.Collection<Range<Token>> ranges)
public java.util.Set<SSTableReader> currentlyRepairing(java.util.UUID cfId, java.util.UUID parentRepairSession)
public com.google.common.util.concurrent.ListenableFuture<?> finishParentSession(java.util.UUID parentSession, java.util.Set<java.net.InetAddress> neighbors, boolean doAntiCompaction) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
parentSession
- Parent session IDneighbors
- Repair participants (not including self)java.lang.InterruptedException
java.util.concurrent.ExecutionException
public ActiveRepairService.ParentRepairSession getParentRepairSession(java.util.UUID parentSessionId)
public ActiveRepairService.ParentRepairSession removeParentRepairSession(java.util.UUID parentSessionId)
public com.google.common.util.concurrent.ListenableFuture<java.util.List<java.lang.Object>> doAntiCompaction(java.util.UUID parentRepairSession)
parentRepairSession
- parent repair session IDpublic void handleMessage(java.net.InetAddress endpoint, RepairMessage message)
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 state)
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 ep, double phi)
convict
in interface IFailureDetectionEventListener
ep
- endpoint to be convictedphi
- the value of phi with with ep was convictedCopyright © 2016 The Apache Software Foundation