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
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ActiveRepairService.ParentRepairSession`
    `static class` | `ActiveRepairService.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ActiveRepairService` | `instance`
    `static long` | `UNREPAIRED_SSTABLE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ActiveRepairService()` Protected constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addToActiveSessions(RepairSession session)`
    `java.util.List<java.util.concurrent.Future<?>>` | `doAntiCompaction(java.util.UUID parentRepairSession)`
    `void` | `finishParentSession(java.util.UUID parentSession, java.util.Set<java.net.InetAddress> neighbors, boolean doAntiCompaction)`
    `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.
    `ActiveRepairService.ParentRepairSession` | `getParentRepairSession(java.util.UUID parentSessionId)`
    `void` | `handleMessage(java.net.InetAddress endpoint, RepairMessage message)`
    `java.util.UUID` | `prepareForRepair(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.util.List<ColumnFamilyStore> columnFamilyStores, java.util.Collection<Range<Token>> ranges)`
    `void` | `removeFromActiveSessions(RepairSession session)`
    `RepairFuture` | `submitRepairSession(java.util.UUID parentRepairSession, Range<Token> range, java.lang.String keyspace, boolean isSequential, java.util.Set<java.net.InetAddress> endpoints, 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

    - #### UNREPAIRED_SSTABLE

          public static final long UNREPAIRED_SSTABLE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ActiveRepairService

          protected ActiveRepairService()

      Protected constructor. Use ActiveRepairService.instance.

  - ### Method Detail

    - #### submitRepairSession

          public RepairFuture submitRepairSession(java.util.UUID parentRepairSession,
                                         Range<Token> range,
                                         java.lang.String keyspace,
                                         boolean isSequential,
                                         java.util.Set<java.net.InetAddress> endpoints,
                                         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

    - #### prepareForRepair

          public java.util.UUID prepareForRepair(java.util.Set<java.net.InetAddress> endpoints,
                                        java.util.Collection<Range<Token>> ranges,
                                        java.util.List<ColumnFamilyStore> columnFamilyStores)

    - #### registerParentRepairSession

          public void registerParentRepairSession(java.util.UUID parentRepairSession,
                                         java.util.List<ColumnFamilyStore> columnFamilyStores,
                                         java.util.Collection<Range<Token>> ranges)

    - #### finishParentSession

          public void finishParentSession(java.util.UUID parentSession,
                                 java.util.Set<java.net.InetAddress> neighbors,
                                 boolean doAntiCompaction)
                                   throws java.lang.InterruptedException,
                                          java.util.concurrent.ExecutionException,
                                          java.io.IOException

      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.io.IOException`

    - #### getParentRepairSession

          public ActiveRepairService.ParentRepairSession getParentRepairSession(java.util.UUID parentSessionId)

    - #### doAntiCompaction

          public java.util.List<java.util.concurrent.Future<?>> doAntiCompaction(java.util.UUID parentRepairSession)
                                                                          throws java.lang.InterruptedException,
                                                                                 java.util.concurrent.ExecutionException,
                                                                                 java.io.IOException

      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.io.IOException`

    - #### handleMessage

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

Copyright © 2014 The Apache Software Foundation