public class ActiveRepairService extends java.lang.Object implements IEndpointStateChangeSubscriber, IFailureDetectionEventListener, ActiveRepairServiceMBean
Modifier and Type | Class and Description |
---|---|
static class |
ActiveRepairService.ConsistentSessions |
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.ParentRepairStatus |
static class |
ActiveRepairService.RepairCommandExecutorHandle |
Modifier and Type | Field and Description |
---|---|
ActiveRepairService.ConsistentSessions |
consistent |
static ActiveRepairService |
instance |
static java.util.UUID |
NO_PENDING_REPAIR |
DebuggableThreadPoolExecutor |
snapshotExecutor |
static long |
UNREPAIRED_SSTABLE |
MBEAN_NAME
Constructor and Description |
---|
ActiveRepairService(IFailureDetector failureDetector,
Gossiper gossiper) |
Modifier and Type | Method and Description |
---|---|
void |
abort(java.util.function.Predicate<ActiveRepairService.ParentRepairSession> predicate,
java.lang.String message)
Remove any parent repair sessions matching predicate
|
void |
beforeChange(InetAddressAndPort endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue) |
void |
cleanUp(java.util.UUID parentRepairSession,
java.util.Set<InetAddressAndPort> endpoints)
Send Verb.CLEANUP_MSG to the given endpoints.
|
java.util.List<javax.management.openmbean.CompositeData> |
cleanupPending(java.util.List<java.lang.String> schemaArgs,
java.lang.String rangeString,
boolean force) |
void |
convict(InetAddressAndPort 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.
|
void |
failSession(java.lang.String session,
boolean force) |
static EndpointsForRange |
getNeighbors(java.lang.String keyspaceName,
java.lang.Iterable<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) |
java.util.List<javax.management.openmbean.CompositeData> |
getPendingStats(java.util.List<java.lang.String> schemaArgs,
java.lang.String rangeString) |
int |
getRepairPendingCompactionRejectThreshold() |
int |
getRepairSessionSpaceInMegabytes() |
java.util.List<javax.management.openmbean.CompositeData> |
getRepairStats(java.util.List<java.lang.String> schemaArgs,
java.lang.String rangeString) |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getSessions(boolean all,
java.lang.String rangesStr) |
boolean |
getUseOffheapMerkleTrees() |
void |
handleMessage(Message<? extends RepairMessage> message) |
void |
onAlive(InetAddressAndPort endpoint,
EndpointState state) |
void |
onChange(InetAddressAndPort endpoint,
ApplicationState state,
VersionedValue value) |
void |
onDead(InetAddressAndPort endpoint,
EndpointState state) |
void |
onJoin(InetAddressAndPort endpoint,
EndpointState epState)
Use to inform interested parties about the change in the state
for specified endpoint
|
void |
onRemove(InetAddressAndPort endpoint) |
void |
onRestart(InetAddressAndPort endpoint,
EndpointState state)
Called whenever a node is restarted.
|
int |
parentRepairSessionCount() |
int |
parentRepairSessionsCount()
Each ongoing repair (incremental and non-incremental) is represented by a
ActiveRepairService.ParentRepairSession entry in the ActiveRepairService cache. |
java.util.UUID |
prepareForRepair(java.util.UUID parentRepairSession,
InetAddressAndPort coordinator,
java.util.Set<InetAddressAndPort> endpoints,
RepairOption options,
boolean isForcedRepair,
java.util.List<ColumnFamilyStore> columnFamilyStores) |
void |
recordRepairStatus(int cmd,
ActiveRepairService.ParentRepairStatus parentRepairStatus,
java.util.List<java.lang.String> messages) |
void |
registerParentRepairSession(java.util.UUID parentRepairSession,
InetAddressAndPort coordinator,
java.util.List<ColumnFamilyStore> columnFamilyStores,
java.util.Collection<Range<Token>> ranges,
boolean isIncremental,
long repairedAt,
boolean isGlobal,
PreviewKind previewKind) |
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
|
static java.util.concurrent.ThreadPoolExecutor |
repairCommandExecutor() |
int |
sessionCount() |
void |
setRepairPendingCompactionRejectThreshold(int value) |
void |
setRepairSessionSpaceInMegabytes(int sizeInMegabytes) |
void |
setUseOffheapMerkleTrees(boolean value) |
void |
start() |
void |
stop() |
RepairSession |
submitRepairSession(java.util.UUID parentRepairSession,
CommonRange range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isIncremental,
boolean pullRepair,
PreviewKind previewKind,
boolean optimiseStreams,
com.google.common.util.concurrent.ListeningExecutorService executor,
Scheduler validationScheduler,
java.lang.String... cfnames)
Requests repairs for the given keyspace and column families.
|
void |
terminateSessions() |
static boolean |
verifyCompactionsPendingThreshold(java.util.UUID parentRepairSession,
PreviewKind previewKind) |
public final ActiveRepairService.ConsistentSessions consistent
public static final ActiveRepairService instance
public static final long UNREPAIRED_SSTABLE
public static final java.util.UUID NO_PENDING_REPAIR
public final DebuggableThreadPoolExecutor snapshotExecutor
public ActiveRepairService(IFailureDetector failureDetector, Gossiper gossiper)
public static java.util.concurrent.ThreadPoolExecutor repairCommandExecutor()
public void start()
public void stop()
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getSessions(boolean all, java.lang.String rangesStr)
getSessions
in interface ActiveRepairServiceMBean
public void failSession(java.lang.String session, boolean force)
failSession
in interface ActiveRepairServiceMBean
public void setRepairSessionSpaceInMegabytes(int sizeInMegabytes)
setRepairSessionSpaceInMegabytes
in interface ActiveRepairServiceMBean
public int getRepairSessionSpaceInMegabytes()
getRepairSessionSpaceInMegabytes
in interface ActiveRepairServiceMBean
public java.util.List<javax.management.openmbean.CompositeData> getRepairStats(java.util.List<java.lang.String> schemaArgs, java.lang.String rangeString)
getRepairStats
in interface ActiveRepairServiceMBean
public java.util.List<javax.management.openmbean.CompositeData> getPendingStats(java.util.List<java.lang.String> schemaArgs, java.lang.String rangeString)
getPendingStats
in interface ActiveRepairServiceMBean
public java.util.List<javax.management.openmbean.CompositeData> cleanupPending(java.util.List<java.lang.String> schemaArgs, java.lang.String rangeString, boolean force)
cleanupPending
in interface ActiveRepairServiceMBean
public int parentRepairSessionsCount()
ActiveRepairServiceMBean
ActiveRepairService.ParentRepairSession
entry in the ActiveRepairService
cache.
Returns the current number of ongoing repairs (the current number of cached entries).parentRepairSessionsCount
in interface ActiveRepairServiceMBean
ActiveRepairService.ParentRepairSession
instancespublic RepairSession submitRepairSession(java.util.UUID parentRepairSession, CommonRange range, java.lang.String keyspace, RepairParallelism parallelismDegree, boolean isIncremental, boolean pullRepair, PreviewKind previewKind, boolean optimiseStreams, com.google.common.util.concurrent.ListeningExecutorService executor, Scheduler validationScheduler, java.lang.String... cfnames)
public boolean getUseOffheapMerkleTrees()
getUseOffheapMerkleTrees
in interface ActiveRepairServiceMBean
public void setUseOffheapMerkleTrees(boolean value)
setUseOffheapMerkleTrees
in interface ActiveRepairServiceMBean
public void terminateSessions()
public void recordRepairStatus(int cmd, ActiveRepairService.ParentRepairStatus parentRepairStatus, java.util.List<java.lang.String> messages)
public static EndpointsForRange getNeighbors(java.lang.String keyspaceName, java.lang.Iterable<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 static boolean verifyCompactionsPendingThreshold(java.util.UUID parentRepairSession, PreviewKind previewKind)
public java.util.UUID prepareForRepair(java.util.UUID parentRepairSession, InetAddressAndPort coordinator, java.util.Set<InetAddressAndPort> endpoints, RepairOption options, boolean isForcedRepair, java.util.List<ColumnFamilyStore> columnFamilyStores)
public void cleanUp(java.util.UUID parentRepairSession, java.util.Set<InetAddressAndPort> endpoints)
public void registerParentRepairSession(java.util.UUID parentRepairSession, InetAddressAndPort coordinator, java.util.List<ColumnFamilyStore> columnFamilyStores, java.util.Collection<Range<Token>> ranges, boolean isIncremental, long repairedAt, boolean isGlobal, PreviewKind previewKind)
public ActiveRepairService.ParentRepairSession getParentRepairSession(java.util.UUID parentSessionId)
public ActiveRepairService.ParentRepairSession removeParentRepairSession(java.util.UUID parentSessionId)
parentSessionId
- id of parent sessionCassandraTableRepairManager.snapshot(String, Collection, boolean)
public void handleMessage(Message<? extends RepairMessage> message)
public void onJoin(InetAddressAndPort 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(InetAddressAndPort endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue)
beforeChange
in interface IEndpointStateChangeSubscriber
public void onChange(InetAddressAndPort endpoint, ApplicationState state, VersionedValue value)
onChange
in interface IEndpointStateChangeSubscriber
public void onAlive(InetAddressAndPort endpoint, EndpointState state)
onAlive
in interface IEndpointStateChangeSubscriber
public void onDead(InetAddressAndPort endpoint, EndpointState state)
onDead
in interface IEndpointStateChangeSubscriber
public void onRemove(InetAddressAndPort endpoint)
onRemove
in interface IEndpointStateChangeSubscriber
public void onRestart(InetAddressAndPort 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(InetAddressAndPort ep, double phi)
convict
in interface IFailureDetectionEventListener
ep
- endpoint to be convictedphi
- the value of phi with with ep was convictedpublic int getRepairPendingCompactionRejectThreshold()
getRepairPendingCompactionRejectThreshold
in interface ActiveRepairServiceMBean
public void setRepairPendingCompactionRejectThreshold(int value)
setRepairPendingCompactionRejectThreshold
in interface ActiveRepairServiceMBean
public void abort(java.util.function.Predicate<ActiveRepairService.ParentRepairSession> predicate, java.lang.String message)
public int parentRepairSessionCount()
public int sessionCount()
Copyright © 2009- The Apache Software Foundation