Package org.apache.solr.util.hll
Interface ISchemaVersion
-
public interface ISchemaVersionA serialization schema for HLLs. Reads and writes HLL metadata to and frombyte[]representations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IWordDeserializergetDeserializer(HLLType type, int wordLength, byte[] bytes)Builds an HLL deserializer that matches this schema version.org.apache.solr.util.hll.IWordSerializergetSerializer(HLLType type, int wordLength, int wordCount)Builds an HLL serializer that matches this schema version.intpaddingBytes(HLLType type)The number of metadata bytes required for a serialized HLL of the specified type.org.apache.solr.util.hll.IHLLMetadatareadMetadata(byte[] bytes)Reads the metadata bytes of the serialized HLL.intschemaVersionNumber()voidwriteMetadata(byte[] bytes, org.apache.solr.util.hll.IHLLMetadata metadata)Writes metadata bytes to serialized HLL.
-
-
-
Method Detail
-
paddingBytes
int paddingBytes(HLLType type)
The number of metadata bytes required for a serialized HLL of the specified type.- Parameters:
type- the type of the serialized HLL- Returns:
- the number of padding bytes needed in order to fully accommodate the needed metadata.
-
writeMetadata
void writeMetadata(byte[] bytes, org.apache.solr.util.hll.IHLLMetadata metadata)Writes metadata bytes to serialized HLL.- Parameters:
bytes- the padded data bytes of the HLLmetadata- the metadata to write to the padding bytes
-
readMetadata
org.apache.solr.util.hll.IHLLMetadata readMetadata(byte[] bytes)
Reads the metadata bytes of the serialized HLL.- Parameters:
bytes- the serialized HLL- Returns:
- the HLL metadata
-
getSerializer
org.apache.solr.util.hll.IWordSerializer getSerializer(HLLType type, int wordLength, int wordCount)
Builds an HLL serializer that matches this schema version.- Parameters:
type- the HLL type that will be serialized. This cannot benull.wordLength- the length of the 'words' that comprise the data of the HLL. Words must be at least 5 bits and at most 64 bits long.wordCount- the number of 'words' in the HLL's data.- Returns:
- a byte array serializer used to serialize a HLL according to this schema version's specification.
- See Also:
paddingBytes(HLLType),IWordSerializer
-
getDeserializer
IWordDeserializer getDeserializer(HLLType type, int wordLength, byte[] bytes)
Builds an HLL deserializer that matches this schema version.- Parameters:
type- the HLL type that will be deserialized. This cannot benull.wordLength- the length of the 'words' that comprise the data of the serialized HLL. Words must be at least 5 bits and at most 64 bits long.bytes- the serialized HLL to deserialize. This cannot benull.- Returns:
- a byte array deserializer used to deserialize a HLL serialized according to this schema version's specification.
-
schemaVersionNumber
int schemaVersionNumber()
- Returns:
- the schema version number.
-
-