org.apache.cassandra.service
Class AntiEntropyService.Validator

java.lang.Object
  extended by org.apache.cassandra.service.AntiEntropyService.Validator
All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Object>, AntiEntropyService.IValidator
Enclosing class:
AntiEntropyService

public static class AntiEntropyService.Validator
extends java.lang.Object
implements AntiEntropyService.IValidator, java.util.concurrent.Callable<java.lang.Object>

The IValidator to be used in normal operation.


Field Summary
 org.apache.cassandra.service.AntiEntropyService.CFTuple cf
           
static com.google.common.base.Predicate<DecoratedKey> DKPRED
           
 java.net.InetAddress initiator
           
 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 valdation lifecycle to trigger additional action with the now valid tree.
 void complete()
          Depending on the initiator for the validation, either registers trees to be compared locally in AE_SERVICE_STAGE, or remotely.
 void prepare()
           
 
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.CFTuple cf

initiator

public final java.net.InetAddress initiator

tree

public final MerkleTree tree

DKPRED

public static final com.google.common.base.Predicate<DecoratedKey> DKPRED
Method Detail

prepare

public void prepare()
Specified by:
prepare in interface AntiEntropyService.IValidator

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 three 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). Additionally, there is a special case for the minimum token, because although it sorts first, it is contained in the last possible range.

Specified by:
add in interface AntiEntropyService.IValidator
Parameters:
row - The row.

complete

public void complete()
Depending on the initiator for the validation, either registers trees to be compared locally in AE_SERVICE_STAGE, or remotely.

Specified by:
complete in interface AntiEntropyService.IValidator

call

public java.lang.Object call()
                      throws java.lang.Exception
Called after the valdation lifecycle to trigger additional action with the now valid tree. Runs in AE_SERVICE_STAGE: depending on which node initiated validation, performs different actions.

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


Copyright © 2009 The Apache Software Foundation