Class SchemaVersionOne
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.stat.hll.serialization.SchemaVersionOne
-
- All Implemented Interfaces:
ISchemaVersion
public class SchemaVersionOne extends Object implements ISchemaVersion
A concreteISchemaVersionrepresenting schema version one.
-
-
Field Summary
Fields Modifier and Type Field Description static intSCHEMA_VERSIONThe schema version number for this instance.
-
Constructor Summary
Constructors Constructor Description SchemaVersionOne()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWordDeserializergetDeserializer(HLLType type, int wordLength, byte[] bytes)Builds an HLL deserializer that matches this schema version.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.IHLLMetadatareadMetadata(byte[] bytes)Reads the metadata bytes of the serialized HLL.intschemaVersionNumber()voidwriteMetadata(byte[] bytes, IHLLMetadata metadata)Writes metadata bytes to serialized HLL.
-
-
-
Field Detail
-
SCHEMA_VERSION
public static final int SCHEMA_VERSION
The schema version number for this instance.- See Also:
- Constant Field Values
-
-
Method Detail
-
paddingBytes
public int paddingBytes(HLLType type)
Description copied from interface:ISchemaVersionThe number of metadata bytes required for a serialized HLL of the specified type.- Specified by:
paddingBytesin interfaceISchemaVersion- Parameters:
type- the type of the serialized HLL- Returns:
- the number of padding bytes needed in order to fully accommodate the needed metadata.
-
writeMetadata
public void writeMetadata(byte[] bytes, IHLLMetadata metadata)Description copied from interface:ISchemaVersionWrites metadata bytes to serialized HLL.- Specified by:
writeMetadatain interfaceISchemaVersion- Parameters:
bytes- the padded data bytes of the HLLmetadata- the metadata to write to the padding bytes
-
readMetadata
public IHLLMetadata readMetadata(byte[] bytes)
Description copied from interface:ISchemaVersionReads the metadata bytes of the serialized HLL.- Specified by:
readMetadatain interfaceISchemaVersion- Parameters:
bytes- the serialized HLL- Returns:
- the HLL metadata
-
getSerializer
public IWordSerializer getSerializer(HLLType type, int wordLength, int wordCount)
Description copied from interface:ISchemaVersionBuilds an HLL serializer that matches this schema version.- Specified by:
getSerializerin interfaceISchemaVersion- 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:
ISchemaVersion.paddingBytes(HLLType),IWordSerializer
-
getDeserializer
public IWordDeserializer getDeserializer(HLLType type, int wordLength, byte[] bytes)
Description copied from interface:ISchemaVersionBuilds an HLL deserializer that matches this schema version.- Specified by:
getDeserializerin interfaceISchemaVersion- 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
public int schemaVersionNumber()
- Specified by:
schemaVersionNumberin interfaceISchemaVersion- Returns:
- the schema version number.
-
-