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
Deprecated.
this statuses are from the previous JMX notification service,
which will be deprecated on 4.0. For statuses of the new notification
service, see
StreamEvent.ProgressEvent |
Modifier and Type | Field and Description |
---|---|
static ActiveRepairService |
instance |
static CassandraVersion |
SUPPORTS_GLOBAL_PREPARE_FLAG_VERSION |
static long |
UNREPAIRED_SSTABLE |
Constructor and Description |
---|
ActiveRepairService(IFailureDetector failureDetector,
Gossiper gossiper) |
Modifier and Type | Method and Description |
---|---|
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,
java.util.Collection<Range<Token>> successfulRanges)
Submit anti-compaction jobs to CompactionManager.
|
com.google.common.util.concurrent.ListenableFuture |
finishParentSession(java.util.UUID parentSession,
java.util.Set<java.net.InetAddress> neighbors,
java.util.Collection<Range<Token>> successfulRanges)
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.util.UUID parentRepairSession,
java.net.InetAddress coordinator,
java.util.Set<java.net.InetAddress> endpoints,
RepairOption options,
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,
boolean isIncremental,
long timestamp,
boolean isGlobal) |
ActiveRepairService.ParentRepairSession |
removeParentRepairSession(java.util.UUID parentSessionId)
called when the repair session is done - either failed or anticompaction has completed
clears out any snapshots created by this repair
|
RepairSession |
submitRepairSession(java.util.UUID parentRepairSession,
java.util.Collection<Range<Token>> range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Set<java.net.InetAddress> endpoints,
long repairedAt,
com.google.common.util.concurrent.ListeningExecutorService executor,
java.lang.String... cfnames)
Requests repairs for the given keyspace and column families.
|
void |
terminateSessions() |
public static CassandraVersion SUPPORTS_GLOBAL_PREPARE_FLAG_VERSION
public static final ActiveRepairService instance
public static final long UNREPAIRED_SSTABLE
public ActiveRepairService(IFailureDetector failureDetector, Gossiper gossiper)
public RepairSession submitRepairSession(java.util.UUID parentRepairSession, java.util.Collection<Range<Token>> range, java.lang.String keyspace, RepairParallelism parallelismDegree, java.util.Set<java.net.InetAddress> endpoints, long repairedAt, com.google.common.util.concurrent.ListeningExecutorService executor, java.lang.String... cfnames)
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.util.UUID parentRepairSession, java.net.InetAddress coordinator, java.util.Set<java.net.InetAddress> endpoints, RepairOption options, 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, boolean isIncremental, long timestamp, boolean isGlobal)
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, java.util.Collection<Range<Token>> successfulRanges)
parentSession
- Parent session IDneighbors
- Repair participants (not including self)successfulRanges
- Ranges that repaired successfullypublic ActiveRepairService.ParentRepairSession getParentRepairSession(java.util.UUID parentSessionId)
public ActiveRepairService.ParentRepairSession removeParentRepairSession(java.util.UUID parentSessionId)
parentSessionId
- public com.google.common.util.concurrent.ListenableFuture<java.util.List<java.lang.Object>> doAntiCompaction(java.util.UUID parentRepairSession, java.util.Collection<Range<Token>> successfulRanges)
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 © 2017 The Apache Software Foundation