org.apache.ignite.internal.processors.query.stat.hll.serialization

## 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 concrete `ISchemaVersion` representing schema version one.

### Field Summary

Fields
`static int` `SCHEMA_VERSION` The schema version number for this instance.

### Constructor Summary

Constructors
Constructor and Description
`SchemaVersionOne()`

### Method Summary

All Methods Instance Methods Concrete Methods
`IWordDeserializer` `getDeserializer(HLLType type, int wordLength, byte[] bytes)` Builds an HLL deserializer that matches this schema version.
`IWordSerializer` `getSerializer(HLLType type, int wordLength, int wordCount)` Builds an HLL serializer that matches this schema version.
`int` `paddingBytes(HLLType type)` The number of metadata bytes required for a serialized HLL of the specified type.
`IHLLMetadata` `readMetadata(byte[] bytes)` Reads the metadata bytes of the serialized HLL.
`int` `schemaVersionNumber()`
`void` `writeMetadata(byte[] bytes, IHLLMetadata metadata)` Writes metadata bytes to serialized HLL.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SCHEMA_VERSION

    public static final int SCHEMA_VERSION

The schema version number for this instance.

See Also:
  Constant Field Values

### Constructor Detail

#### SchemaVersionOne

    public SchemaVersionOne()

### Method Detail

#### paddingBytes

    public int paddingBytes(HLLType type)

Description copied from interface: `ISchemaVersion`
The number of metadata bytes required for a serialized HLL of the specified type.

Specified by:
  `paddingBytes` in interface `ISchemaVersion`
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: `ISchemaVersion`
Writes metadata bytes to serialized HLL.

Specified by:
  `writeMetadata` in interface `ISchemaVersion`
Parameters:
  `bytes` - the padded data bytes of the HLL
  `metadata` - the metadata to write to the padding bytes

#### readMetadata

    public IHLLMetadata readMetadata(byte[] bytes)

Description copied from interface: `ISchemaVersion`
Reads the metadata bytes of the serialized HLL.

Specified by:
  `readMetadata` in interface `ISchemaVersion`
Parameters:
  `bytes` - the serialized HLL
Returns:
  the HLL metadata

#### getSerializer

    public IWordSerializer getSerializer(HLLType type,
                                         int wordLength,
                                         int wordCount)

Description copied from interface: `ISchemaVersion`
Builds an HLL serializer that matches this schema version.

Specified by:
  `getSerializer` in interface `ISchemaVersion`
Parameters:
  `type` - the HLL type that will be serialized. This cannot be `null`.
  `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: `ISchemaVersion`
Builds an HLL deserializer that matches this schema version.

Specified by:
  `getDeserializer` in interface `ISchemaVersion`
Parameters:
  `type` - the HLL type that will be deserialized. This cannot be `null`.
  `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 be `null`.
Returns:
  a byte array deserializer used to deserialize a HLL serialized according to this schema version's specification.

#### schemaVersionNumber

    public int schemaVersionNumber()

Specified by:
  `schemaVersionNumber` in interface `ISchemaVersion`
Returns:
  the schema version number.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023