mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +00:00
kv/RocksDBStore: implement rm_single_delete
Use SingleDelete to delete keys which were never overwritten. Signed-off-by: Jianjian Huo <jianjian.huo@ssi.samsung.com>
This commit is contained in:
parent
9c60532eae
commit
2089cff5b5
@ -437,6 +437,12 @@ void RocksDBStore::RocksDBTransactionImpl::rmkey(const string &prefix,
|
|||||||
bat->Delete(combine_strings(prefix, k));
|
bat->Delete(combine_strings(prefix, k));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RocksDBStore::RocksDBTransactionImpl::rm_single_key(const string &prefix,
|
||||||
|
const string &k)
|
||||||
|
{
|
||||||
|
bat->SingleDelete(combine_strings(prefix, k));
|
||||||
|
}
|
||||||
|
|
||||||
void RocksDBStore::RocksDBTransactionImpl::rmkeys_by_prefix(const string &prefix)
|
void RocksDBStore::RocksDBTransactionImpl::rmkeys_by_prefix(const string &prefix)
|
||||||
{
|
{
|
||||||
KeyValueDB::Iterator it = db->get_iterator(prefix);
|
KeyValueDB::Iterator it = db->get_iterator(prefix);
|
||||||
|
@ -147,17 +147,20 @@ public:
|
|||||||
void set(
|
void set(
|
||||||
const string &prefix,
|
const string &prefix,
|
||||||
const string &k,
|
const string &k,
|
||||||
const bufferlist &bl);
|
const bufferlist &bl) override;
|
||||||
void rmkey(
|
void rmkey(
|
||||||
const string &prefix,
|
const string &prefix,
|
||||||
const string &k);
|
const string &k) override;
|
||||||
|
void rm_single_key(
|
||||||
|
const string &prefix,
|
||||||
|
const string &k) override;
|
||||||
void rmkeys_by_prefix(
|
void rmkeys_by_prefix(
|
||||||
const string &prefix
|
const string &prefix
|
||||||
);
|
) override;
|
||||||
void merge(
|
void merge(
|
||||||
const string& prefix,
|
const string& prefix,
|
||||||
const string& k,
|
const string& k,
|
||||||
const bufferlist &bl);
|
const bufferlist &bl) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
KeyValueDB::Transaction get_transaction() {
|
KeyValueDB::Transaction get_transaction() {
|
||||||
|
Loading…
Reference in New Issue
Block a user