Class MerkleTreeConfig

All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class MerkleTreeConfig
extends Object
implements IdentifiedDataSerializable
Configuration for a merkle tree. The merkle tree is a data structure used for efficient comparison of the difference in the contents of large data structures. The precision of such a comparison mechanism is defined by the depth of the merkle tree.

A larger depth means that a data synchronization mechanism will be able to pinpoint a smaller subset of the data structure contents in which a change occurred. This causes the synchronization mechanism to be more efficient. On the other hand, a larger tree depth means the merkle tree will consume more memory.

A smaller depth means the data synchronization mechanism will have to transfer larger chunks of the data structure in which a possible change happened. On the other hand, a shallower tree consumes less memory. The depth must be between 2 and 27 (exclusive). The default depth is 10.

As the comparison mechanism is iterative, a larger depth will also prolong the duration of the comparison mechanism. Care must be taken to not have large tree depths if the latency of the comparison operation is high. The default depth is 10.