Class MerkleTreeConfig
- All Implemented Interfaces:
- DataSerializable,- IdentifiedDataSerializable,- com.hazelcast.nio.serialization.impl.Versioned
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.
See https://en.wikipedia.org/wiki/Merkle_tree.
- Since:
- 3.11
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanintReturns type identifier for this class.intgetDepth()Returns the depth of the merkle tree.Returns if the merkle tree is enabled.intReturns DataSerializableFactory factory ID for this class.final inthashCode()booleanDeprecated.booleanMethod introduced for client protocol compatibility.voidReads fields from the input streamsetDepth(int depth) Sets the depth of the merkle tree.setEnabled(boolean enabled) Enables or disables the merkle tree.toString()voidWrites object fields to output stream
- 
Constructor Details- 
MerkleTreeConfigpublic MerkleTreeConfig()
- 
MerkleTreeConfigClones aMerkleTreeConfig.- Parameters:
- config- the merkle tree config to clone
- Throws:
- NullPointerException- if the config is null
 
 
- 
- 
Method Details- 
toString
- 
getDepthpublic int getDepth()Returns the depth of the merkle tree. The default depth is 10.
- 
setDepthSets the depth of the merkle tree. The depth must be between 27 and 2 (exclusive).- Parameters:
- depth- the depth of the merkle tree
- Returns:
- the updated config
- Throws:
- InvalidConfigurationException- if the- depthis greater than 27 or less than 2
 
- 
isEnabledDeprecated.usegetEnabled()instead.Returns if the merkle tree is enabled.- Returns:
- trueif the merkle tree is enabled,- falseotherwise
 
- 
getEnabledReturns if the merkle tree is enabled.- Returns:
- TRUEif the merkle tree is enabled,- FALSEif disabled or- nullif user did not explicitly configure Merkle trees, so it may or may not be enabled by Hazelcast.
 
- 
isEnabledSetMethod introduced for client protocol compatibility.- Returns:
- whether enabledfield is set or not.
 
- 
setEnabledEnables or disables the merkle tree.- Parameters:
- enabled-- trueif enabled,- falseotherwise.
- Returns:
- the updated config
 
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic final int hashCode()
 
- 
getEnabled()instead.