Validator (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.repair

## Class Validator

- java.lang.Object
- - org.apache.cassandra.repair.Validator

- All Implemented Interfaces:
    java.lang.Runnable

      public class Validator
      extends java.lang.Object
      implements java.lang.Runnable

  Handles the building of a merkle tree for a column family. Lifecycle: 1. prepare() - Initialize tree with samples. 2. add() - 0 or more times, to add hashes to the tree. 3. complete() - Enqueues any operations that were blocked waiting for a valid tree.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `RepairJobDesc` | `desc`
    `int` | `gcBefore`
    `java.net.InetAddress` | `initiator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Validator(RepairJobDesc desc, java.net.InetAddress initiator, int gcBefore)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(AbstractCompactedRow row)` Called (in order) for every row present in the CF.
    `void` | `complete()` Registers the newly created tree for rendezvous in Stage.ANTIENTROPY.
    `void` | `completeTree()`
    `void` | `fail()` Called when some error during the validation happened.
    `void` | `prepare(ColumnFamilyStore cfs, MerkleTree tree)`
    `void` | `run()` Called after the validation lifecycle to respond with the now valid tree.

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

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

- - ### Field Detail

    - #### desc

          public final RepairJobDesc desc

    - #### initiator

          public final java.net.InetAddress initiator

    - #### gcBefore

          public final int gcBefore

  - ### Constructor Detail

    - #### Validator

          public Validator(RepairJobDesc desc,
                   java.net.InetAddress initiator,
                   int gcBefore)

  - ### Method Detail

    - #### prepare

          public void prepare(ColumnFamilyStore cfs,
                     MerkleTree tree)

    - #### add

          public void add(AbstractCompactedRow row)

      Called (in order) for every row present in the CF. Hashes the row, and adds it to the tree being built.
      Parameters:
        `row` - Row to add hash

    - #### complete

          public void complete()

      Registers the newly created tree for rendezvous in Stage.ANTIENTROPY.

    - #### completeTree

          public void completeTree()

    - #### fail

          public void fail()

      Called when some error during the validation happened. This sends RepairStatus to inform the initiator that the validation has failed. The actual reason for failure should be looked up in the log of the host calling this function.

    - #### run

          public void run()

      Called after the validation lifecycle to respond with the now valid tree. Runs in Stage.ANTIENTROPY.
      Specified by:
        `run` in interface `java.lang.Runnable`

Copyright © 2014 The Apache Software Foundation