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 TimeUUID |
NO_PENDING_REPAIR |
ExecutorPlus |
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(TimeUUID 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 |
clearLocalRepairState() |
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.
|
CoordinatorState |
coordinator(TimeUUID id) |
java.util.Collection<CoordinatorState> |
coordinators() |
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(TimeUUID parentSessionId)
We assume when calling this method that a parent session for the provided identifier
exists, and that session is still in progress.
|
int |
getPaxosRepairParallelism() |
java.util.List<javax.management.openmbean.CompositeData> |
getPendingStats(java.util.List<java.lang.String> schemaArgs,
java.lang.String rangeString) |
int |
getRepairPendingCompactionRejectThreshold() |
int |
getRepairSessionSpaceInMebibytes() |
int |
getRepairSessionSpaceInMegabytes()
Deprecated.
|
java.util.List<javax.management.openmbean.CompositeData> |
getRepairStats(java.util.List<java.lang.String> schemaArgs,
java.lang.String rangeString) |
Pair<ActiveRepairService.ParentRepairStatus,java.util.List<java.lang.String>> |
getRepairStatus(java.lang.Integer cmd) |
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. |
ParticipateState |
participate(TimeUUID id) |
java.util.Collection<ParticipateState> |
participates() |
TimeUUID |
prepareForRepair(TimeUUID 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 |
register(CoordinatorState state) |
boolean |
register(ParticipateState state) |
void |
registerParentRepairSession(TimeUUID 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(TimeUUID parentSessionId)
called when the repair session is done - either failed or anticompaction has completed
|
static ExecutorPlus |
repairCommandExecutor() |
Future<?> |
repairPaxosForTopologyChange(java.lang.String ksName,
java.util.Collection<Range<Token>> ranges,
java.lang.String reason) |
int |
sessionCount() |
void |
setPaxosRepairParallelism(int v) |
void |
setRepairPendingCompactionRejectThreshold(int value) |
void |
setRepairSessionSpaceInMebibytes(int sizeInMebibytes) |
void |
setRepairSessionSpaceInMegabytes(int sizeInMegabytes)
Deprecated.
|
void |
setUseOffheapMerkleTrees(boolean value) |
void |
shutdownNowAndWait(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
start() |
void |
stop() |
RepairSession |
submitRepairSession(TimeUUID parentRepairSession,
CommonRange range,
java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isIncremental,
boolean pullRepair,
PreviewKind previewKind,
boolean optimiseStreams,
boolean repairPaxos,
boolean paxosOnly,
ExecutorPlus executor,
java.lang.String... cfnames)
Requests repairs for the given keyspace and column families.
|
void |
terminateSessions() |
ValidationState |
validation(java.util.UUID id) |
java.util.Collection<ValidationState> |
validations() |
static boolean |
verifyCompactionsPendingThreshold(TimeUUID parentRepairSession,
PreviewKind previewKind) |
public final ActiveRepairService.ConsistentSessions consistent
public static final ActiveRepairService instance
public static final long UNREPAIRED_SSTABLE
public static final TimeUUID NO_PENDING_REPAIR
public final ExecutorPlus snapshotExecutor
public ActiveRepairService(IFailureDetector failureDetector, Gossiper gossiper)
public static ExecutorPlus repairCommandExecutor()
public void start()
public void clearLocalRepairState()
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
@Deprecated public void setRepairSessionSpaceInMegabytes(int sizeInMegabytes)
setRepairSessionSpaceInMegabytes
in interface ActiveRepairServiceMBean
@Deprecated public int getRepairSessionSpaceInMegabytes()
getRepairSessionSpaceInMegabytes
in interface ActiveRepairServiceMBean
public void setRepairSessionSpaceInMebibytes(int sizeInMebibytes)
setRepairSessionSpaceInMebibytes
in interface ActiveRepairServiceMBean
public int getRepairSessionSpaceInMebibytes()
getRepairSessionSpaceInMebibytes
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(TimeUUID parentRepairSession, CommonRange range, java.lang.String keyspace, RepairParallelism parallelismDegree, boolean isIncremental, boolean pullRepair, PreviewKind previewKind, boolean optimiseStreams, boolean repairPaxos, boolean paxosOnly, ExecutorPlus executor, 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 Pair<ActiveRepairService.ParentRepairStatus,java.util.List<java.lang.String>> getRepairStatus(java.lang.Integer cmd)
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(TimeUUID parentRepairSession, PreviewKind previewKind)
public TimeUUID prepareForRepair(TimeUUID parentRepairSession, InetAddressAndPort coordinator, java.util.Set<InetAddressAndPort> endpoints, RepairOption options, boolean isForcedRepair, java.util.List<ColumnFamilyStore> columnFamilyStores)
public void cleanUp(TimeUUID parentRepairSession, java.util.Set<InetAddressAndPort> endpoints)
public void registerParentRepairSession(TimeUUID 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(TimeUUID parentSessionId) throws NoSuchRepairSessionException
abort(Predicate, String)
or failRepair(TimeUUID, String)
have removed it.parentSessionId
- an identifier for an active parent repair sessionActiveRepairService.ParentRepairSession
associated with the provided identifierNoSuchRepairSessionException
- if the provided identifier does not map to an active parent sessionpublic ActiveRepairService.ParentRepairSession removeParentRepairSession(TimeUUID parentSessionId)
clears out any snapshots created by this repair
parentSessionId
- an identifier for an active parent repair sessionActiveRepairService.ParentRepairSession
associated with the provided identifierCassandraTableRepairManager.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)
The fail marker is kept in the map for 24h to make sure that if the coordinator does not agree that the repair failed, we need to fail the entire repair session
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()
public Future<?> repairPaxosForTopologyChange(java.lang.String ksName, java.util.Collection<Range<Token>> ranges, java.lang.String reason)
public int getPaxosRepairParallelism()
getPaxosRepairParallelism
in interface ActiveRepairServiceMBean
public void setPaxosRepairParallelism(int v)
setPaxosRepairParallelism
in interface ActiveRepairServiceMBean
public void shutdownNowAndWait(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public java.util.Collection<CoordinatorState> coordinators()
public CoordinatorState coordinator(TimeUUID id)
public void register(CoordinatorState state)
public boolean register(ParticipateState state)
public java.util.Collection<ParticipateState> participates()
public ParticipateState participate(TimeUUID id)
public java.util.Collection<ValidationState> validations()
public ValidationState validation(java.util.UUID id)
Copyright © 2009-2022 The Apache Software Foundation