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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns type identifier for this class.com.hazelcast.cardinality.impl.hyperloglog.HyperLogLogmerge(SplitBrainMergeTypes.CardinalityEstimatorMergeTypes mergingValue, SplitBrainMergeTypes.CardinalityEstimatorMergeTypes existingValue) Selects the value of either the merging or the existingMergingValuewhich 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:SplitBrainMergePolicySelects the value of either the merging or the existingMergingValuewhich should be merged.Note that the existing
MergingValueinstance may benullif no matching data could be found to the mergingMergingValue.- Parameters:
mergingValue-MergingValueinstance that has the merging data of the smaller sub-clusterexistingValue-MergingValueinstance that has the existing data ornullif no matching data exists- Returns:
- the selected value for merging
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Returns:
- type ID
-