// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace storage { class MergeStatus : public document::Printable { public: std::shared_ptr reply; std::vector full_node_list; std::vector nodeList; framework::MicroSecTime maxTimestamp; std::deque diff; api::StorageMessage::Id pendingId; std::shared_ptr pendingGetDiff; std::shared_ptr pendingApplyDiff; vespalib::duration timeout; framework::MilliSecTimer startTime; std::optional> delayed_error; spi::Context context; MergeStatus(const framework::Clock&, api::StorageMessage::Priority, uint32_t traceLevel); ~MergeStatus() override; /** * Note: hasMask parameter and _entry._hasMask in part vector are per-reply masks, * based on the nodes returned in ApplyBucketDiffReply. * @return true if any entries were removed from the internal diff * or the two diffs had entries with mismatching hasmasks, which * indicates that bucket contents have changed during the merge. */ bool removeFromDiff(const std::vector& part, uint16_t hasMask, const std::vector &nodes); void print(std::ostream& out, bool verbose, const std::string& indent) const override; bool isFirstNode() const { return static_cast(reply); } void set_delayed_error(std::future&& delayed_error_in); void check_delayed_error(api::ReturnCode &return_code); }; } // storage