Package org.apache.druid.hll
Class VersionOneHyperLogLogCollector
- java.lang.Object
-
- org.apache.druid.hll.HyperLogLogCollector
-
- org.apache.druid.hll.VersionOneHyperLogLogCollector
-
- All Implemented Interfaces:
Comparable<HyperLogLogCollector>
public class VersionOneHyperLogLogCollector extends HyperLogLogCollector
-
-
Field Summary
Fields Modifier and Type Field Description static intHEADER_NUM_BYTESstatic intMAX_OVERFLOW_REGISTER_BYTEstatic intMAX_OVERFLOW_VALUE_BYTEstatic intNUM_BYTES_FOR_DENSE_STORAGEstatic intNUM_NON_ZERO_REGISTERS_BYTEstatic intREGISTER_OFFSET_BYTEstatic byteVERSIONHeader: Byte 0: version Byte 1: registerOffset Byte 2-3: numNonZeroRegisters Byte 4: maxOverflowValue Byte 5-6: maxOverflowRegister-
Fields inherited from class org.apache.druid.hll.HyperLogLogCollector
BITS_FOR_BUCKETS, CORRECTION_PARAMETER, DENSE_THRESHOLD, HIGH_CORRECTION_THRESHOLD, LOW_CORRECTION_THRESHOLD, NUM_BUCKETS, NUM_BYTES_FOR_BUCKETS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description shortgetMaxOverflowRegister()bytegetMaxOverflowValue()intgetNumBytesForDenseStorage()intgetNumHeaderBytes()shortgetNumNonZeroRegisters()intgetPayloadBytePosition()intgetPayloadBytePosition(ByteBuffer buffer)bytegetRegisterOffset()bytegetVersion()voidsetMaxOverflowRegister(short register)voidsetMaxOverflowRegister(ByteBuffer buffer, short register)voidsetMaxOverflowValue(byte value)voidsetMaxOverflowValue(ByteBuffer buffer, byte value)voidsetNumNonZeroRegisters(short numNonZeroRegisters)voidsetNumNonZeroRegisters(ByteBuffer buffer, short numNonZeroRegisters)voidsetRegisterOffset(byte registerOffset)voidsetRegisterOffset(ByteBuffer buffer, byte registerOffset)voidsetVersion(ByteBuffer buffer)-
Methods inherited from class org.apache.druid.hll.HyperLogLogCollector
add, add, applyCorrection, compareTo, equals, estimateByteBuffer, estimateCardinality, estimateCardinalityRound, fold, fold, getInitPosition, getLatestNumBytesForDenseStorage, getStorageBuffer, hashCode, makeCollector, makeCollectorSharingStorage, makeEmptyVersionedByteArray, makeLatestCollector, toByteArray, toByteBuffer, toString
-
-
-
-
Field Detail
-
VERSION
public static final byte VERSION
Header: Byte 0: version Byte 1: registerOffset Byte 2-3: numNonZeroRegisters Byte 4: maxOverflowValue Byte 5-6: maxOverflowRegister- See Also:
- Constant Field Values
-
REGISTER_OFFSET_BYTE
public static final int REGISTER_OFFSET_BYTE
- See Also:
- Constant Field Values
-
NUM_NON_ZERO_REGISTERS_BYTE
public static final int NUM_NON_ZERO_REGISTERS_BYTE
- See Also:
- Constant Field Values
-
MAX_OVERFLOW_VALUE_BYTE
public static final int MAX_OVERFLOW_VALUE_BYTE
- See Also:
- Constant Field Values
-
MAX_OVERFLOW_REGISTER_BYTE
public static final int MAX_OVERFLOW_REGISTER_BYTE
- See Also:
- Constant Field Values
-
HEADER_NUM_BYTES
public static final int HEADER_NUM_BYTES
- See Also:
- Constant Field Values
-
NUM_BYTES_FOR_DENSE_STORAGE
public static final int NUM_BYTES_FOR_DENSE_STORAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public byte getVersion()
- Specified by:
getVersionin classHyperLogLogCollector
-
setVersion
public void setVersion(ByteBuffer buffer)
- Specified by:
setVersionin classHyperLogLogCollector
-
getRegisterOffset
public byte getRegisterOffset()
- Specified by:
getRegisterOffsetin classHyperLogLogCollector
-
setRegisterOffset
public void setRegisterOffset(byte registerOffset)
- Specified by:
setRegisterOffsetin classHyperLogLogCollector
-
setRegisterOffset
public void setRegisterOffset(ByteBuffer buffer, byte registerOffset)
- Specified by:
setRegisterOffsetin classHyperLogLogCollector
-
getNumNonZeroRegisters
public short getNumNonZeroRegisters()
- Specified by:
getNumNonZeroRegistersin classHyperLogLogCollector
-
setNumNonZeroRegisters
public void setNumNonZeroRegisters(short numNonZeroRegisters)
- Specified by:
setNumNonZeroRegistersin classHyperLogLogCollector
-
setNumNonZeroRegisters
public void setNumNonZeroRegisters(ByteBuffer buffer, short numNonZeroRegisters)
- Specified by:
setNumNonZeroRegistersin classHyperLogLogCollector
-
getMaxOverflowValue
public byte getMaxOverflowValue()
- Specified by:
getMaxOverflowValuein classHyperLogLogCollector
-
setMaxOverflowValue
public void setMaxOverflowValue(byte value)
- Specified by:
setMaxOverflowValuein classHyperLogLogCollector
-
setMaxOverflowValue
public void setMaxOverflowValue(ByteBuffer buffer, byte value)
- Specified by:
setMaxOverflowValuein classHyperLogLogCollector
-
getMaxOverflowRegister
public short getMaxOverflowRegister()
- Specified by:
getMaxOverflowRegisterin classHyperLogLogCollector
-
setMaxOverflowRegister
public void setMaxOverflowRegister(short register)
- Specified by:
setMaxOverflowRegisterin classHyperLogLogCollector
-
setMaxOverflowRegister
public void setMaxOverflowRegister(ByteBuffer buffer, short register)
- Specified by:
setMaxOverflowRegisterin classHyperLogLogCollector
-
getNumHeaderBytes
public int getNumHeaderBytes()
- Specified by:
getNumHeaderBytesin classHyperLogLogCollector
-
getNumBytesForDenseStorage
public int getNumBytesForDenseStorage()
- Specified by:
getNumBytesForDenseStoragein classHyperLogLogCollector
-
getPayloadBytePosition
public int getPayloadBytePosition()
- Specified by:
getPayloadBytePositionin classHyperLogLogCollector
-
getPayloadBytePosition
public int getPayloadBytePosition(ByteBuffer buffer)
- Specified by:
getPayloadBytePositionin classHyperLogLogCollector
-
-