bplustree_node
const bplustree_node* fNode;
BPlusTree::_FindKey(const bplustree_node* node, const uint8* key,
const bplustree_node* node;
const bplustree_node* node, CachedNode& cached,
off_t* _offset, bplustree_node** _fragment, uint32* _index)
if (bplustree_node::LinkType(value) != BPLUSTREE_DUPLICATE_FRAGMENT)
const bplustree_node* fragment = cached.SetTo(
bplustree_node::FragmentOffset(value), false);
uint32 num = bplustree_node::MaxFragments(fNodeSize);
*_offset = bplustree_node::FragmentOffset(value);
const bplustree_node* node, uint16 index, off_t value)
if (bplustree_node::IsDuplicate(oldValue)) {
if (bplustree_node::LinkType(oldValue)
bplustree_node* duplicate = cachedDuplicate.SetToWritable(
transaction, bplustree_node::FragmentOffset(oldValue), false);
bplustree_node::FragmentIndex(oldValue));
(int)bplustree_node::FragmentIndex(oldValue),
bplustree_node::FragmentOffset(oldValue), arrayCount,
offset = bplustree_node::FragmentOffset(oldValue);
bplustree_node* newDuplicate;
= HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(
const bplustree_node* duplicate;
duplicateOffset = bplustree_node::FragmentOffset(oldValue);
bplustree_node* writableDuplicate
bplustree_node* newDuplicate;
bplustree_node* fragment;
values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(
BPlusTree::_InsertKey(bplustree_node* node, uint16 index, uint8* key,
BPlusTree::_SplitNode(bplustree_node* node, off_t nodeOffset,
bplustree_node* other, off_t otherOffset, uint16* _keyIndex, uint8* key,
if (key_align(sizeof(bplustree_node) + bytes + keyLengths)
const bplustree_node* node;
bplustree_node* writableNode = cached.MakeWritable(transaction);
if (int32(key_align(sizeof(bplustree_node)
bplustree_node* root;
bplustree_node* other;
bplustree_node* root = cachedNewRoot.Node();
const bplustree_node* node, CachedNode& cached, uint16 index,
off_t duplicateOffset = bplustree_node::FragmentOffset(oldValue);
bplustree_node* duplicate = cachedDuplicate.SetToWritable(transaction,
if (bplustree_node::LinkType(oldValue) == BPLUSTREE_DUPLICATE_FRAGMENT) {
bplustree_node::FragmentIndex(oldValue));
(int)bplustree_node::FragmentIndex(oldValue), duplicateOffset,
bplustree_node::MakeLink(
bplustree_node* fragment = NULL;
values[index] = HOST_ENDIAN_TO_BFS_INT64(bplustree_node::MakeLink(
BPlusTree::_RemoveKey(bplustree_node* node, uint16 index)
const bplustree_node* node;
if (bplustree_node::IsDuplicate(BFS_ENDIAN_TO_HOST_INT64(
bplustree_node* writableNode = cached.MakeWritable(transaction);
bplustree_node* other = otherCached.SetToWritable(transaction,
const bplustree_node* node;
bplustree_node* writableNode = cached.MakeWritable(transaction);
const bplustree_node* node;
const bplustree_node* parent)
if (bplustree_node::IsDuplicate(childOffset)) {
off_t duplicateOffset = bplustree_node::FragmentOffset(childOffset);
const bplustree_node* node;
bool isFragmentNode = bplustree_node::LinkType(childOffset)
bplustree_node::FragmentIndex(childOffset));
const bplustree_node* previous = cached.SetTo(lastOffset, true);
const bplustree_node* node;
const bplustree_node* node;
const bplustree_node* node;
node = cached.SetTo(bplustree_node::FragmentOffset(fDuplicateNode),
uint8 type = bplustree_node::LinkType(offset);
node = cached.SetTo(bplustree_node::FragmentOffset(fDuplicateNode),
const bplustree_node* node;
const bplustree_node*
bplustree_node::FragmentOffset(fDuplicateNode), fDuplicateNode,
const bplustree_node* node;
bplustree_node::Initialize()
bplustree_node::KeyAt(int32 index, uint16* keyLength) const
bplustree_node::CountDuplicates(off_t offset, bool isFragment) const
bplustree_node::DuplicateAt(off_t offset, bool isFragment, int8 index) const
bplustree_node::FragmentsUsed(uint32 nodeSize) const
CachedNode::SetTo(off_t offset, const bplustree_node** _node, bool check)
bplustree_node::CheckIntegrity(uint32 nodeSize) const
bplustree_node*
bplustree_node*
fNode = (bplustree_node*)(block + offset
CachedNode::Allocate(Transaction& transaction, bplustree_node** _node,
NodeChecker(const bplustree_node* node, int32 nodeSize, const char* text)
const bplustree_node* node;
const bplustree_node* root;
bplustree_node* node = cached.SetToWritable(transaction, NodeSize(), false);
bplustree_node* node = cached.SetToWritable(transaction, offset, false);
const bplustree_node* SetTo(off_t offset, bool check = true);
const bplustree_node** _node,
bplustree_node* SetToWritable(Transaction& transaction,
bplustree_node* MakeWritable(Transaction& transaction);
bplustree_node** _node, off_t* _offset);
bplustree_node* Node() const { return fNode; }
bplustree_node* fNode;
struct bplustree_node;
status_t _FindKey(const bplustree_node* node,
const bplustree_node* node,
bplustree_node** _fragment, uint32* _index);
const bplustree_node* node, uint16 index,
void _InsertKey(bplustree_node* node, uint16 index,
status_t _SplitNode(bplustree_node* node,
off_t nodeOffset, bplustree_node* other,
const bplustree_node* node,
void _RemoveKey(bplustree_node* node, uint16 index);
const bplustree_node* parent);
inline bool CheckNode(const bplustree_node* node) const;
bplustree_header::CheckNode(const bplustree_node* node) const
bplustree_node::KeyLengths() const
return (Unaligned<uint16>*)(((char*)this) + key_align(sizeof(bplustree_node)
bplustree_node::Values() const
bplustree_node::Keys() const
return (uint8*)this + sizeof(bplustree_node);
bplustree_node::Used() const
return key_align(sizeof(bplustree_node) + AllKeyLength()) + NumKeys()
bplustree_node::IsLeaf() const
bplustree_node::FragmentAt(int8 index) const
bplustree_node::DuplicateArray() const
bplustree_node::LinkType(off_t link)
bplustree_node::MakeLink(uint8 type, off_t link, uint32 fragmentIndex)
bplustree_node::IsDuplicate(off_t link)
bplustree_node::FragmentOffset(off_t link)
bplustree_node::FragmentIndex(off_t link)
bplustree_node::MaxFragments(uint32 nodeSize)
dump_bplustree_node(const bplustree_node* node, const bplustree_header* header,
if (bplustree_node::LinkType(*value)
} else if (bplustree_node::LinkType(*value)
bplustree_node* node = (bplustree_node*)parse_expression(argv[1]);
struct bplustree_node;
extern void dump_bplustree_node(const bplustree_node *node,
bplustree_node *node = (bplustree_node *)(buffer + nodeSize);
node = (bplustree_node *)((addr_t)node + nodeSize);
if (bplustree_node::LinkType(value) == BPLUSTREE_NODE)
bplustree_node *rootNode = NULL;
bplustree_node *node;
BPlusTree::CheckNode(bplustree_node *node)
bplustree_node *BPlusTree::Node(off_t nodeOffset,bool check)
bplustree_node *node = (bplustree_node *)malloc(fNodeSize);
uint8 *bplustree_node::KeyAt(int32 index,uint16 *keyLength) const
uint8 bplustree_node::CountDuplicates(off_t offset,bool isFragment) const
off_t bplustree_node::DuplicateAt(off_t offset,bool isFragment,int8 index) const
bplustree_node *node = fCache.Get(header.root_node_pointer);
CacheableNode(off_t offset,bplustree_node *node)
bplustree_node *node;
bplustree_node *node = fCache.Get(offset);
void BPlusTree::SetCurrentNode(bplustree_node *node,off_t offset,int8 to)
bplustree_node *node;
bplustree_node *node;
node = fCache.Get(bplustree_node::FragmentOffset(fDuplicateNode));
bplustree_node *fNode;
uint8 type = bplustree_node::LinkType(offset);
node = fCache.Get(bplustree_node::FragmentOffset(fDuplicateNode));
status_t BPlusTree::FindKey(bplustree_node *node,uint8 *key,uint16 keyLength,uint16 *index,off_t *next)
bplustree_node *
bplustree_node *node;
void BPlusTree::InsertKey(bplustree_node *node,uint8 *key,uint16 keyLength,off_t value,uint16 index)
status_t BPlusTree::InsertDuplicate(bplustree_node */*node*/,uint16 /*index*/)
status_t BPlusTree::SplitNode(bplustree_node *node,off_t nodeOffset,uint16 *_keyIndex,uint8 *key,uint16 *_keyLength,off_t *_value)
bplustree_node *other = fCache.Get(otherOffset = fHeader->maximum_size); //Node(otherOffset = fHeader->maximum_size/*,false*/);
if (round_up(sizeof(bplustree_node) + bytesBefore + bytesAfter + bytes) +
bplustree_node *left = fCache.Get(other->left_link);
bplustree_node *node;
if (int32(round_up(sizeof(bplustree_node) + node->all_key_length + keyLength)
void SetCurrentNode(bplustree_node *node,off_t offset,int8 to = BPLUSTREE_BEGIN);
status_t FindKey(bplustree_node *node, uint8 *key, uint16 keyLength, uint16 *index = NULL, off_t *next = NULL);
status_t SplitNode(bplustree_node *node, off_t nodeOffset, uint16 *_keyIndex, uint8 *key, uint16 *_keyLength, off_t *_value);
void InsertKey(bplustree_node *node, uint8 *key, uint16 keyLength, off_t value, uint16 index);
status_t InsertDuplicate(bplustree_node *node,uint16 index);
bool CheckNode(bplustree_node *node);
bplustree_node *Node(off_t nodeoffset,bool check = true);
inline uint16 *bplustree_node::KeyLengths() const
return (uint16 *)(((char *)this) + round_up(sizeof(bplustree_node) + all_key_length));
inline off_t *bplustree_node::Values() const
inline uint8 *bplustree_node::Keys() const
return (uint8 *)this + sizeof(bplustree_node);
inline int32 bplustree_node::Used() const
return round_up(sizeof(bplustree_node) + all_key_length) + all_key_count * (sizeof(uint16) + sizeof(off_t));
inline uint8 bplustree_node::LinkType(off_t link)
inline off_t bplustree_node::FragmentOffset(off_t link)
bplustree_node *Get(off_t offset);
dump_bplustree_node(const bplustree_node* node, const bplustree_header* header,
if (bplustree_node::LinkType(*value)
} else if (bplustree_node::LinkType(*value)
struct bplustree_node;
extern void dump_bplustree_node(const bplustree_node* node,
bplustree_node* node = (bplustree_node*)gBlocks.ItemAt(i);