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

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

    public class AntiEntropyService

extends java.lang.Object

AntiEntropyService encapsulates "validating" (hashing) individual column families, exchanging MerkleTrees with remote nodes via a TreeRequest/Response conversation, and then triggering repairs for disagreeing ranges. Every Tree conversation has an 'initiator', where valid trees are sent after generation and where the local and remote tree will rendezvous in rendezvous(cf, endpoint, tree). Once the trees rendezvous, a Differencer is executed and the service can trigger repairs for disagreeing ranges. Tree comparison and repair triggering occur in the single threaded AE_SERVICE_STAGE. The steps taken to enact a repair are as follows: 1. A repair is triggered via nodeprobe: * Nodeprobe sends TreeRequest messages to all neighbors of the target node: when a node receives a TreeRequest, it will perform a readonly compaction to immediately validate the column family. 2. The compaction process validates the column family by: * Calling Validator.prepare(), which samples the column family to determine key distribution, * Calling Validator.add() in order for every row in the column family, * Calling Validator.complete() to indicate that all rows have been added. * Calling complete() indicates that a valid MerkleTree has been created for the column family. * The valid tree is returned to the requesting node via a TreeResponse. 3. When a node receives a TreeResponse, it passes the tree to rendezvous(), which checks for trees to rendezvous with / compare to: * If the tree is local, it is cached, and compared to any trees that were received from neighbors. * If the tree is remote, it is immediately compared to a local tree if one is cached. Otherwise, the remote tree is stored until a local tree can be generated. * A Differencer object is enqueued for each comparison. 4. Differencers are executed in AE_SERVICE_STAGE, to compare the two trees, and perform repair via the streaming api.

Nested Class Summary
`static class` | `AntiEntropyService.Differencer` Compares two trees, and launches repairs for disagreeing ranges.
`static class` | `AntiEntropyService.TreeRequestVerbHandler` Handler for requests from remote nodes to generate a valid tree.
`static class` | `AntiEntropyService.TreeResponseVerbHandler` Handler for responses from remote nodes which contain a valid tree.
`static class` | `AntiEntropyService.Validator` A Strategy to handle building and validating a merkle tree for a column family.

Field Summary
`static AntiEntropyService` | `instance`
`static long` | `REQUEST_TIMEOUT`

Constructor Summary
`protected` | `AntiEntropyService()` Protected constructor.

Method Summary
`static java.util.Set<java.net.InetAddress>` | `getNeighbors(java.lang.String table)` Return all of the neighbors with whom we share data.

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

Field Detail

### REQUEST_TIMEOUT

    public static final long REQUEST_TIMEOUT

See Also:
  Constant Field Values

### instance

    public static final AntiEntropyService instance

Constructor Detail

### AntiEntropyService

    protected AntiEntropyService()

  Protected constructor. Use AntiEntropyService.instance.

Method Detail

### getNeighbors

    public static java.util.Set<java.net.InetAddress> getNeighbors(java.lang.String table)

  Return all of the neighbors with whom we share data.

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