org.apache.cassandra.service

## Class ActiveRepairService

- java.lang.Object
- - org.apache.cassandra.service.ActiveRepairService

    public class ActiveRepairService
    extends java.lang.Object

ActiveRepairService is the starting point for manual "active" repairs. Each user triggered repair will correspond to one or multiple repair session, one for each token range to repair. On repair session might repair multiple column families. For each of those column families, the repair session will request merkle trees for each replica of the range being repaired, diff those trees upon receiving them, schedule the streaming ofthe parts to repair (based on the tree diffs) and wait for all those operation. See RepairSession for more details. The creation of a repair session is done through the submitRepairSession that returns a future on the completion of that session.

### Nested Class Summary

Nested Classes
`static class` `ActiveRepairService.Status`

### Field Summary

Fields
`static ActiveRepairService` `instance`

### Constructor Summary

Constructors
`protected` `ActiveRepairService()` Protected constructor.

### Method Summary

Methods
`void` `addToActiveSessions(RepairSession session)`
`static java.util.Set<java.net.InetAddress>` `getNeighbors(java.lang.String keyspaceName, 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.
`void` `handleMessage(java.net.InetAddress endpoint, RepairMessage message)`
`void` `removeFromActiveSessions(RepairSession session)`
`RepairFuture` `submitRepairSession(Range<Token> range, java.lang.String keyspace, boolean isSequential, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts, java.lang.String... cfnames)` Requests repairs for the given keyspace and column families.
`void` `terminateSessions()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### instance

    public static final ActiveRepairService instance

### Constructor Detail

#### ActiveRepairService

    protected ActiveRepairService()

Protected constructor. Use ActiveRepairService.instance.

### Method Detail

#### submitRepairSession

    public RepairFuture submitRepairSession(Range<Token> range,
                                   java.lang.String keyspace,
                                   boolean isSequential,
                                   java.util.Collection<java.lang.String> dataCenters,
                                   java.util.Collection<java.lang.String> hosts,
                                   java.lang.String... cfnames)

Requests repairs for the given keyspace and column families.

Returns:
  Future for asynchronous call or null if there is no need to repair

#### addToActiveSessions

    public void addToActiveSessions(RepairSession session)

#### removeFromActiveSessions

    public void removeFromActiveSessions(RepairSession session)

#### terminateSessions

    public void terminateSessions()

#### getNeighbors

    public static java.util.Set<java.net.InetAddress> getNeighbors(java.lang.String keyspaceName,
                                                   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.

Parameters:
  `keyspaceName` - keyspace to repair
  `toRepair` - token to repair
  `dataCenters` - the data centers to involve in the repair
Returns:
  neighbors with whom we share the provided range

#### handleMessage

    public void handleMessage(java.net.InetAddress endpoint,
                     RepairMessage message)