Class SchemaVersionOne

    • 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.