ActiveRepairService.ParentRepairSession (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.service

## Class ActiveRepairService.ParentRepairSession

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

- Enclosing class:
    ActiveRepairService

      public static class ActiveRepairService.ParentRepairSession
      extends java.lang.Object

  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. We use the PRS to avoid anticompacting the sstables 768 times, instead we take all repaired ranges at the end of the repair and anticompact once. We do an optimistic marking of sstables - when we start an incremental repair we mark all unrepaired sstables as repairing (@see markSSTablesRepairing), then while the repair is ongoing compactions might remove those sstables, and when it is time for anticompaction we will only anticompact the sstables that are still on disk. Note that validation and streaming do not care about which sstables we have marked as repairing - they operate on all unrepaired sstables (if it is incremental), otherwise we would not get a correct repair.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.net.InetAddress` | `coordinator`
    `boolean` | `isGlobal`
    `boolean` | `isIncremental`
    `long` | `repairedAt`
    `java.util.Map<java.util.UUID,java.util.Set<java.lang.String>>` | `sstableMap`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParentRepairSession(java.net.InetAddress coordinator, java.util.List<ColumnFamilyStore> columnFamilyStores, java.util.Collection<Range<Token>> ranges, boolean isIncremental, boolean isGlobal, long repairedAt)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Refs<SSTableReader>` | `getActiveRepairedSSTableRefsForAntiCompaction(java.util.UUID cfId, java.util.UUID parentSessionId)` Get the still active sstables we should run anticompaction on note that validation and streaming do not call this method - they have to work on the actual active sstables on the node, we only call this to know which sstables are still there that were there when we started the repair
    `long` | `getRepairedAt()`
    `void` | `markSSTablesRepairing(java.util.UUID cfId, java.util.UUID parentSessionId)` Mark sstables repairing - either all sstables or only the unrepaired ones depending on whether this is an incremental or full repair
    `void` | `maybeSnapshot(java.util.UUID cfId, java.util.UUID parentSessionId)`
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### sstableMap

          public final java.util.Map<java.util.UUID,java.util.Set<java.lang.String>> sstableMap

    - #### isIncremental

          public final boolean isIncremental

    - #### isGlobal

          public final boolean isGlobal

    - #### repairedAt

          public final long repairedAt

    - #### coordinator

          public final java.net.InetAddress coordinator

  - ### Constructor Detail

    - #### ParentRepairSession

          public ParentRepairSession(java.net.InetAddress coordinator,
                                     java.util.List<ColumnFamilyStore> columnFamilyStores,
                                     java.util.Collection<Range<Token>> ranges,
                                     boolean isIncremental,
                                     boolean isGlobal,
                                     long repairedAt)

  - ### Method Detail

    - #### markSSTablesRepairing

          public void markSSTablesRepairing(java.util.UUID cfId,
                                            java.util.UUID parentSessionId)

      Mark sstables repairing - either all sstables or only the unrepaired ones depending on whether this is an incremental or full repair
      Parameters:
        `cfId` - the column family
        `parentSessionId` - the parent repair session id, used to make sure we don't start multiple repairs over the same sstables

    - #### getActiveRepairedSSTableRefsForAntiCompaction

          public Refs<SSTableReader> getActiveRepairedSSTableRefsForAntiCompaction(java.util.UUID cfId,
                                                                                   java.util.UUID parentSessionId)

      Get the still active sstables we should run anticompaction on note that validation and streaming do not call this method - they have to work on the actual active sstables on the node, we only call this to know which sstables are still there that were there when we started the repair
      Parameters:
        `cfId` -
        `parentSessionId` - for checking if there exists a snapshot for this repair
      Returns:

    - #### maybeSnapshot

          public void maybeSnapshot(java.util.UUID cfId,
                                    java.util.UUID parentSessionId)

    - #### getRepairedAt

          public long getRepairedAt()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2018 The Apache Software Foundation