mirror of
https://github.com/ceph/ceph
synced 2025-03-19 17:06:24 +00:00
crimson/onode-staged-tree: implement staged::is_keys_one()
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
parent
eb4c03f4ef
commit
c4b5e7fecd
@ -858,8 +858,20 @@ struct staged {
|
||||
|
||||
static bool is_keys_one(
|
||||
const container_t& container) { // IN
|
||||
// TODO
|
||||
ceph_abort("not implemented");
|
||||
auto iter = iterator_t(container);
|
||||
iter.seek_last();
|
||||
if (iter.index() == 0) {
|
||||
if constexpr (IS_BOTTOM) {
|
||||
// ok, there is only 1 key
|
||||
return true;
|
||||
} else {
|
||||
auto nxt_container = iter.get_nxt_container();
|
||||
return NXT_STAGE_T::is_keys_one(nxt_container);
|
||||
}
|
||||
} else {
|
||||
// more than 1 keys
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template <bool GET_KEY>
|
||||
|
Loading…
Reference in New Issue
Block a user