@Public public interface NormalizableKey<T> extends Comparable<T>, Key<T>
The latter depends on whether the normalized key covers the entire key or is just a prefix of the key. A normalized key is considered a prefix, if its length is less than the maximal normalized key length.
Modifier and Type | Method and Description |
---|---|
void |
copyNormalizedKey(MemorySegment memory,
int offset,
int len)
Writes a normalized key for the given record into the target byte array, starting at the
specified position an writing exactly the given number of bytes.
|
int |
getMaxNormalizedKeyLen()
Gets the maximal length of normalized keys that the data type would produce to determine the
order of instances solely by the normalized key.
|
read, write
compareTo
int getMaxNormalizedKeyLen()
Integer
.MAX_VALUE is interpreted as infinite.
For example, 32 bit integers return four, while Strings (potentially unlimited in length)
return Integer
.MAX_VALUE.
void copyNormalizedKey(MemorySegment memory, int offset, int len)
int byteI = bytes[i] & 0xFF;
If the meaningful part of the normalized key takes less than the given number of bytes,
then it must be padded. Padding is typically required for variable length data types, such as
strings. The padding uses a special character, either 0
or 0xff
, depending on
whether shorter values are sorted to the beginning or the end.
memory
- The memory segment to put the normalized key bytes into.offset
- The offset in the byte array where the normalized key's bytes should start.len
- The number of bytes to put.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.