Exemplo n.º 1
0
bool Tree::del(Slice key)
{
    assert(root_);
    InnerNode *root = root_;
    root->inc_ref();
    bool ret = root->del(key);
    root->dec_ref();
    return ret;
}
Exemplo n.º 2
0
void Tree::lock_path(Slice key, std::vector<DataNode*>& path)
{
    assert(root_);
    InnerNode *root = root_;
    root->inc_ref();
    root->write_lock();
    path.push_back(root);
    root->lock_path(key, path);
}
Exemplo n.º 3
0
bool Tree::put(Slice key, Slice value)
{
    assert(root_);
    InnerNode *root = root_;
    root->inc_ref();
    bool ret = root->put(key, value);
    root->dec_ref();
    return ret;
}
Exemplo n.º 4
0
bool Tree::get(Slice key, Slice& value)
{
    assert(root_);
    InnerNode *root = root_;
    root->inc_ref();
    bool ret = root->find(key, value, NULL);
    root->dec_ref();
    return ret;
}