public class SkipListUtils extends Object
Constructor and Description |
---|
SkipListUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getKeyDataOffset(int level)
Returns the offset of key data in the key space.
|
static int |
getKeyLen(MemorySegment memorySegment,
int offset)
Returns the length of the key.
|
static int |
getKeyMetaLen(int level)
Returns the length of key meta with the given level.
|
static long |
getKeyPointer(MemorySegment memorySegment,
int offset)
Return the pointer to key space.
|
static int |
getLevel(MemorySegment memorySegment,
int offset)
Returns the level of the node.
|
static long |
getNextIndexNode(MemorySegment memorySegment,
int offset,
int level)
Returns next key pointer on the given index level.
|
static long |
getNextKeyPointer(MemorySegment memorySegment,
int offset)
Returns the next key pointer on level 0.
|
static long |
getNextValuePointer(MemorySegment memorySegment,
int offset)
Return the pointer to next value space.
|
static NodeStatus |
getNodeStatus(MemorySegment memorySegment,
int offset)
Returns the status of the node.
|
static long |
getPrevIndexNode(MemorySegment memorySegment,
int offset,
int totalLevel,
int level)
Returns previous key pointer on the given index level.
|
static int |
getValueLen(MemorySegment memorySegment,
int offset)
Return the length of value data.
|
static int |
getValueMetaLen()
Returns the length of value meta.
|
static long |
getValuePointer(MemorySegment memorySegment,
int offset)
Returns the value pointer.
|
static int |
getValueVersion(MemorySegment memorySegment,
int offset)
Returns the version of value.
|
static void |
putKeyData(MemorySegment segment,
int offset,
MemorySegment keySegment,
int keyOffset,
int keyLen,
int level)
Puts the key data into key space.
|
static void |
putKeyLen(MemorySegment memorySegment,
int offset,
int keyLen)
Puts the length of key to the key space.
|
static void |
putKeyPointer(MemorySegment memorySegment,
int offset,
long keyPointer)
Puts the pointer of key space.
|
static void |
putLevelAndNodeStatus(MemorySegment memorySegment,
int offset,
int level,
NodeStatus status)
Puts the level and status to the key space.
|
static void |
putNextIndexNode(MemorySegment memorySegment,
int offset,
int level,
long nextKeyPointer)
Puts next key pointer on the given index level to key space.
|
static void |
putNextKeyPointer(MemorySegment memorySegment,
int offset,
long nextKeyPointer)
Puts the next key pointer on level 0 to key space.
|
static void |
putNextValuePointer(MemorySegment memorySegment,
int offset,
long nextValuePointer)
Puts the pointer of next value space.
|
static void |
putPrevIndexNode(MemorySegment memorySegment,
int offset,
int totalLevel,
int level,
long prevKeyPointer)
Puts previous key pointer on the given index level to key space.
|
static void |
putValueData(MemorySegment memorySegment,
int offset,
byte[] value)
Puts the value data into value space.
|
static void |
putValueLen(MemorySegment memorySegment,
int offset,
int valueLen)
Puts the length of value data.
|
static void |
putValuePointer(MemorySegment memorySegment,
int offset,
long valuePointer)
Puts the value pointer to key space.
|
static void |
putValueVersion(MemorySegment memorySegment,
int offset,
int version)
Puts the version of value to value space.
|
public static int getLevel(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.public static NodeStatus getNodeStatus(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.public static void putLevelAndNodeStatus(MemorySegment memorySegment, int offset, int level, NodeStatus status)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.level
- the level.status
- the status.public static int getKeyLen(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.public static void putKeyLen(MemorySegment memorySegment, int offset, int keyLen)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.keyLen
- length of key.public static long getValuePointer(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.public static void putValuePointer(MemorySegment memorySegment, int offset, long valuePointer)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.valuePointer
- the value pointer.public static long getNextKeyPointer(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.public static void putNextKeyPointer(MemorySegment memorySegment, int offset, long nextKeyPointer)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.nextKeyPointer
- next key pointer on level 0.public static long getNextIndexNode(MemorySegment memorySegment, int offset, int level)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.level
- level of index.public static void putNextIndexNode(MemorySegment memorySegment, int offset, int level, long nextKeyPointer)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.level
- level of index.nextKeyPointer
- next key pointer on the given level.public static long getPrevIndexNode(MemorySegment memorySegment, int offset, int totalLevel, int level)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.totalLevel
- the level of the node.level
- on which level to get the previous key pointer of the node.public static void putPrevIndexNode(MemorySegment memorySegment, int offset, int totalLevel, int level, long prevKeyPointer)
memorySegment
- memory segment for key space.offset
- offset of key space in the memory segment.totalLevel
- top level of the key.level
- level of index.prevKeyPointer
- previous key pointer on the given level.public static int getKeyMetaLen(int level)
level
- level of the key.public static int getKeyDataOffset(int level)
level
- level of the key.public static void putKeyData(MemorySegment segment, int offset, MemorySegment keySegment, int keyOffset, int keyLen, int level)
segment
- memory segment for key space.offset
- offset of key space in memory segment.keySegment
- memory segment for key data.keyOffset
- offset of key data in memory segment.keyLen
- length of key data.level
- level of the key.public static int getValueVersion(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.public static void putValueVersion(MemorySegment memorySegment, int offset, int version)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.version
- version of value.public static long getKeyPointer(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.public static void putKeyPointer(MemorySegment memorySegment, int offset, long keyPointer)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.keyPointer
- pointer to key space.public static long getNextValuePointer(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.public static void putNextValuePointer(MemorySegment memorySegment, int offset, long nextValuePointer)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.nextValuePointer
- pointer to next value space.public static int getValueLen(MemorySegment memorySegment, int offset)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.public static void putValueLen(MemorySegment memorySegment, int offset, int valueLen)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.valueLen
- length of value data.public static int getValueMetaLen()
public static void putValueData(MemorySegment memorySegment, int offset, byte[] value)
memorySegment
- memory segment for value space.offset
- offset of value space in memory segment.value
- value data.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.