Package org.apache.cassandra.repair
Class Validator
java.lang.Object
org.apache.cassandra.repair.Validator
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionfinal SharedContextfinal RepairJobDescfinal InetAddressAndPortfinal booleanfinal longfinal ValidationState -
Constructor Summary
ConstructorsConstructorDescriptionValidator(SharedContext ctx, ValidationState state, long nowInSec, boolean evenTreeDistribution, boolean isIncremental, PreviewKind previewKind) Validator(SharedContext ctx, ValidationState state, long nowInSec, boolean isIncremental, PreviewKind previewKind) Validator(ValidationState state, long nowInSec, boolean isIncremental, PreviewKind previewKind) Validator(ValidationState state, long nowInSec, PreviewKind previewKind) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(UnfilteredRowIterator partition) Called (in order) for every row present in the CF.voidcomplete()Registers the newly created tree for rendezvous in Stage.ANTIENTROPY.voidCalled when some error during the validation happened.booleanvoidprepare(ColumnFamilyStore cfs, MerkleTrees trees, TopPartitionTracker.Collector topPartitionCollector) voidrun()Called after the validation lifecycle to respond with the now valid tree.
-
Field Details
-
desc
-
initiator
-
nowInSec
public final long nowInSec -
isIncremental
public final boolean isIncremental -
ctx
-
state
-
topPartitionCollector
-
-
Constructor Details
-
Validator
-
Validator
public Validator(ValidationState state, long nowInSec, boolean isIncremental, PreviewKind previewKind)
-
-
Method Details
-
prepare
public void prepare(ColumnFamilyStore cfs, MerkleTrees trees, TopPartitionTracker.Collector topPartitionCollector) -
add
Called (in order) for every row present in the CF. Hashes the row, and adds it to the tree being built.- Parameters:
partition- Partition to add hash
-
findCorrectRange
-
complete
public void complete()Registers the newly created tree for rendezvous in Stage.ANTIENTROPY. -
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. -
getPreviewKind
-