Node256Leaf is a bitmask containing 256 bits.
More...
|
|
static constexpr NType | NODE_256_LEAF = NType::NODE_256_LEAF |
|
static constexpr uint16_t | CAPACITY = Node256::CAPACITY |
|
|
uint16_t | count |
|
validity_t | mask [CAPACITY/sizeof(validity_t)] |
Node256Leaf is a bitmask containing 256 bits.
◆ New()
Get a new Node256Leaf handle and initialize the leaf.
155234 {
155237
155238 NodeHandle<Node256Leaf> handle(art, node);
155239 auto &n = handle.Get();
155240
155241 n.count = 0;
155242 ValidityMask mask(&n.mask[0], Node256::CAPACITY);
155243 mask.SetAllInvalid(CAPACITY);
155244
155245 return handle;
155246}
IndexPointer New()
Get a new IndexPointer to a segment, might cause a new buffer allocation.
Definition duckdb.cpp:156189
void SetMetadata(const uint8_t metadata)
Set metadata (Bits 56-63).
Definition duckdb.hpp:22544
static FixedSizeAllocator & GetAllocator(const ART &art, const NType type)
Get a reference to the allocator.
Definition duckdb.cpp:154663
◆ InsertByte()
| void duckdb::Node256Leaf::InsertByte |
( |
ART & | art, |
|
|
Node & | node, |
|
|
const uint8_t | byte ) |
|
static |
Insert a byte.
155248 {
155249 NodeHandle<Node256Leaf> handle(art, node);
155250 auto &n = handle.Get();
155251
155252 n.count++;
155253 ValidityMask mask(&n.mask[0], Node256::CAPACITY);
155254 mask.SetValid(byte);
155255}
◆ DeleteByte()
| void duckdb::Node256Leaf::DeleteByte |
( |
ART & | art, |
|
|
Node & | node, |
|
|
const uint8_t | byte ) |
|
static |
Delete a byte.
155257 {
155258 {
155259 NodeHandle<Node256Leaf> handle(art, node);
155260 auto &n = handle.Get();
155261
155262 n.count--;
155263 ValidityMask mask(&n.mask[0], Node256::CAPACITY);
155264 mask.SetInvalid(byte);
155265
155266 if (n.count > Node48::SHRINK_THRESHOLD) {
155267 return;
155268 }
155269 }
155270
155271 auto node256 = node;
155273}
static void ShrinkNode256Leaf(ART &art, Node &node15_leaf, Node &node256_leaf)
We shrink at <= Node48::SHRINK_THRESHOLD.
Definition duckdb.cpp:153599
◆ HasByte()
| bool duckdb::Node256Leaf::HasByte |
( |
const uint8_t | byte | ) |
|
Returns true, if the byte exists, else false.
155275 {
155276 ValidityMask v_mask(&mask[0], Node256::CAPACITY);
155277 return v_mask.RowIsValid(byte);
155278}
◆ GetBytes()
Returns a pointer to the bytes in the leaf. The pointer data is valid as long as the arena is valid.
155280 {
155281 auto mem = arena.AllocateAligned(sizeof(uint8_t) * count);
155282 array_ptr<uint8_t> bytes(mem, count);
155283
155284 ValidityMask v_mask(&mask[0], Node256::CAPACITY);
155286 for (uint16_t i = 0; i < CAPACITY; i++) {
155287 if (v_mask.RowIsValid(i)) {
155288 bytes[ptr_idx++] = UnsafeNumericCast<uint8_t>(i);
155289 }
155290 }
155291
155292 return bytes;
155293}
◆ GetNextByte()
| bool duckdb::Node256Leaf::GetNextByte |
( |
uint8_t & | byte | ) |
|
Get the first byte greater or equal to the byte. Returns true, if such a byte exists, else false.
155295 {
155296 ValidityMask v_mask(&mask[0], Node256::CAPACITY);
155297 for (uint16_t i = byte; i < CAPACITY; i++) {
155298 if (v_mask.RowIsValid(i)) {
155299 byte = UnsafeNumericCast<uint8_t>(i);
155300 return true;
155301 }
155302 }
155303
155304 return false;
155305}
◆ GrowNode15Leaf()
| void duckdb::Node256Leaf::GrowNode15Leaf |
( |
ART & | art, |
|
|
Node & | node256_leaf, |
|
|
Node & | node15_leaf ) |
|
staticprivate |
155307 {
155308 {
155309 NodeHandle<Node15Leaf> n15_handle(art, node15_leaf);
155310 auto &n15 = n15_handle.Get();
155311
155312 auto n256_handle =
New(art, node256_leaf);
155313 auto &n256 = n256_handle.Get();
155314 node256_leaf.SetGateStatus(node15_leaf.GetGateStatus());
155315
155316 n256.count = n15.count;
155317 ValidityMask mask(&n256.mask[0], Node256::CAPACITY);
155318 for (uint8_t i = 0; i < n15.count; i++) {
155319 mask.SetValid(n15.key[i]);
155320 }
155321 }
155323}
static NodeHandle< Node256Leaf > New(ART &art, Node &node)
Get a new Node256Leaf handle and initialize the leaf.
Definition duckdb.cpp:155234
static void FreeNode(ART &art, Node &node)
Free the node.
Definition duckdb.cpp:154622
The documentation for this class was generated from the following file: