Get the hint from its first key when rebuilding a node extent.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
// so use rebuild_extent() as a workaround to rebuild the node from a
// fresh extent, thus no need to generate delta.
auto left_addr = left_for_merge->impl->laddr();
- return left_for_merge->rebuild_extent(c, L_ADDR_MIN
+ return left_for_merge->rebuild_extent(c
).si_then([c, update_index_after_merge,
left_addr,
merge_stage = merge_stage,
});
}
-eagain_ifuture<NodeExtentMutable> Node::rebuild_extent(context_t c, laddr_t hint)
+eagain_ifuture<NodeExtentMutable> Node::rebuild_extent(context_t c)
{
LOG_PREFIX(OTree::Node::rebuild_extent);
DEBUGT("{} ...", c.t, get_name());
// note: laddr can be changed after rebuild, but we don't fix the parent
// mapping as it is part of the merge process.
- return impl->rebuild_extent(c, hint);
+ return impl->rebuild_extent(c);
}
eagain_ifuture<> Node::retire(context_t c, Ref<Node>&& this_ref)
eagain_ifuture<> erase_node(context_t, Ref<Node>&&);
template <bool FORCE_MERGE = false>
eagain_ifuture<> fix_parent_index(context_t, Ref<Node>&&, bool);
- eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t, laddr_t);
+ eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t);
eagain_ifuture<> retire(context_t, Ref<Node>&&);
void make_tail(context_t);
virtual std::tuple<match_stage_t, search_position_t> erase(const search_position_t&) = 0;
virtual std::tuple<match_stage_t, std::size_t> evaluate_merge(NodeImpl&) = 0;
virtual search_position_t merge(NodeExtentMutable&, NodeImpl&, match_stage_t, extent_len_t) = 0;
- virtual eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t, laddr_t) = 0;
+ virtual eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t) = 0;
virtual eagain_ifuture<> retire_extent(context_t) = 0;
virtual search_position_t make_tail() = 0;
}
eagain_ifuture<NodeExtentMutable>
- rebuild_extent(context_t c, laddr_t hint) override {
+ rebuild_extent(context_t c) override {
+ assert(!is_keys_empty());
+ full_key_t<KeyT::VIEW> first_index;
+ STAGE_T::template get_slot<true, false>(
+ extent.read(), position_t::begin(), &first_index, nullptr);
+ auto hint = first_index.get_hint();
return extent.rebuild(c, hint).si_then([this] (auto mut) {
// addr may change
build_name();
ceph_abort("impossible path"); }
search_position_t merge(NodeExtentMutable&, NodeImpl&, match_stage_t, extent_len_t) override {
ceph_abort("impossible path"); }
- eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t, laddr_t) override {
+ eagain_ifuture<NodeExtentMutable> rebuild_extent(context_t) override {
ceph_abort("impossible path"); }
node_stats_t get_stats() const override {
ceph_abort("impossible path"); }