public class SchemaVersionOne extends Object implements ISchemaVersion
ISchemaVersion
representing schema version one.Modifier and Type | Field and Description |
---|---|
static int |
SCHEMA_VERSION
The schema version number for this instance.
|
Constructor and Description |
---|
SchemaVersionOne() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int SCHEMA_VERSION
public int paddingBytes(HLLType type)
ISchemaVersion
paddingBytes
in interface ISchemaVersion
type
- the type of the serialized HLLpublic void writeMetadata(byte[] bytes, IHLLMetadata metadata)
ISchemaVersion
writeMetadata
in interface ISchemaVersion
bytes
- the padded data bytes of the HLLmetadata
- the metadata to write to the padding bytespublic IHLLMetadata readMetadata(byte[] bytes)
ISchemaVersion
readMetadata
in interface ISchemaVersion
bytes
- the serialized HLLpublic IWordSerializer getSerializer(HLLType type, int wordLength, int wordCount)
ISchemaVersion
getSerializer
in interface ISchemaVersion
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.ISchemaVersion.paddingBytes(HLLType)
,
IWordSerializer
public IWordDeserializer getDeserializer(HLLType type, int wordLength, byte[] bytes)
ISchemaVersion
getDeserializer
in interface ISchemaVersion
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
.public int schemaVersionNumber()
schemaVersionNumber
in interface ISchemaVersion
Copyright © 2017. All rights reserved.