public class MerkleTreeConfig extends Object implements IdentifiedDataSerializable
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 and (exclusive). The default depth is .
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 .
See https://en.wikipedia.org/wiki/Merkle_tree.
Constructor and Description |
---|
MerkleTreeConfig() |
MerkleTreeConfig(MerkleTreeConfig config)
Clones a
MerkleTreeConfig . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getDepth()
Returns the depth of the merkle tree.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
String |
getMapName()
Returns the map name to which this config applies.
|
int |
hashCode() |
boolean |
isEnabled()
Returns if the merkle tree is enabled.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
MerkleTreeConfig |
setDepth(int depth)
Sets the depth of the merkle tree.
|
MerkleTreeConfig |
setEnabled(boolean enabled)
Enables or disables the merkle tree.
|
MerkleTreeConfig |
setMapName(String mapName)
Sets the map name to which this config applies.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public MerkleTreeConfig()
public MerkleTreeConfig(MerkleTreeConfig config)
MerkleTreeConfig
.config
- the merkle tree config to cloneNullPointerException
- if the config is nullpublic int getDepth()
public MerkleTreeConfig setDepth(int depth)
depth
- the depth of the merkle treeConfigurationException
- if the depth
is greater than
or less than public boolean isEnabled()
true
if the merkle tree is enabled, false
otherwisepublic MerkleTreeConfig setEnabled(boolean enabled)
enabled
- true
if enabled, false
otherwise.public String getMapName()
public MerkleTreeConfig setMapName(String mapName)
mapName
- the map nameIllegalArgumentException
- if the mapName
is null
or empty.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.