Package com.hazelcast.spi.merge
Class HyperLogLogMergePolicy
java.lang.Object
com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog,SplitBrainMergeTypes.CardinalityEstimatorMergeTypes,com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog>
com.hazelcast.spi.merge.HyperLogLogMergePolicy
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
,SplitBrainMergePolicy<com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog,
SplitBrainMergeTypes.CardinalityEstimatorMergeTypes, com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog>
public class HyperLogLogMergePolicy
extends com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy<com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog,SplitBrainMergeTypes.CardinalityEstimatorMergeTypes,com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog>
Only available for HyperLogLog backed
CardinalityEstimator
.
Uses the default merge algorithm from HyperLogLog research, keeping the max register value of the two given instances. The result should be the union to the two HyperLogLog estimations.
- Since:
- 3.10
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns type identifier for this class.com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog
merge
(SplitBrainMergeTypes.CardinalityEstimatorMergeTypes mergingValue, SplitBrainMergeTypes.CardinalityEstimatorMergeTypes existingValue) Selects the value of either the merging or the existingMergingValue
which should be merged.Methods inherited from class com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy
getFactoryId, readData, writeData
-
Constructor Details
-
HyperLogLogMergePolicy
public HyperLogLogMergePolicy()
-
-
Method Details
-
merge
public com.hazelcast.cardinality.impl.hyperloglog.HyperLogLog merge(SplitBrainMergeTypes.CardinalityEstimatorMergeTypes mergingValue, SplitBrainMergeTypes.CardinalityEstimatorMergeTypes existingValue) Description copied from interface:SplitBrainMergePolicy
Selects the value of either the merging or the existingMergingValue
which should be merged.Note that the existing
MergingValue
instance may benull
if no matching data could be found to the mergingMergingValue
.- Parameters:
mergingValue
-MergingValue
instance that has the merging data of the smaller sub-clusterexistingValue
-MergingValue
instance that has the existing data ornull
if no matching data exists- Returns:
- the selected value for merging
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Returns:
- type ID
-