Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.service
Class AntiEntropyService.Validator

    java.lang.Object
      org.apache.cassandra.service.AntiEntropyService.Validator

All Implemented Interfaces:
  java.util.concurrent.Callable<java.lang.Object>

Enclosing class:
  AntiEntropyService

    public static class AntiEntropyService.Validator

extends java.lang.Object
implements java.util.concurrent.Callable<java.lang.Object>

A Strategy to handle building and validating 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
`org.apache.cassandra.service.AntiEntropyService.CFPair` | `cf`
`static MerkleTree.RowHash` | `EMPTY_ROW`
`MerkleTree` | `tree`

Method Summary
`void` | `add(CompactionIterator.CompactedRow row)` Called (in order) for every row present in the CF.
`java.lang.Object` | `call()` Called after the validation lifecycle to trigger additional action with the now valid tree.
`void` | `complete()` Registers the newly created tree for rendezvous in AE_SERVICE_STAGE.
`void` | `prepare(ColumnFamilyStore cfs)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### cf

    public final org.apache.cassandra.service.AntiEntropyService.CFPair cf

### tree

    public final MerkleTree tree

### EMPTY_ROW

    public static final MerkleTree.RowHash EMPTY_ROW

Method Detail

### prepare

    public void prepare(ColumnFamilyStore cfs)

### add

    public void add(CompactionIterator.CompactedRow row)

  Called (in order) for every row present in the CF. Hashes the row, and adds it to the tree being built. There are four possible cases: 1. Token is greater than range.right (we haven't generated a range for it yet), 2. Token is less than/equal to range.left (the range was valid), 3. Token is contained in the range (the range is in progress), 4. No more invalid ranges exist. TODO: Because we only validate completely empty trees at the moment, we do not bother dealing with case 2 and case 4 should result in an error. Additionally, there is a special case for the minimum token, because although it sorts first, it is contained in the last possible range.

  Parameters:
    `row` - The row.

### complete

    public void complete()

  Registers the newly created tree for rendezvous in AE_SERVICE_STAGE.

### call

    public java.lang.Object call()
                          throws java.lang.Exception

  Called after the validation lifecycle to trigger additional action with the now valid tree. Runs in AE_SERVICE_STAGE.

  Specified by:
    `call` in interface `java.util.concurrent.Callable<java.lang.Object>`
  Returns:
    A meaningless object.
  Throws:
    `java.lang.Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 The Apache Software Foundation