// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "operationdonecontext.h" #include #include #include namespace document { class Document; } namespace proton { class DocIdLimit; /** * Context class for document put operations that acks operation when * instance is destroyed. Typically a shared pointer to an instance is * passed around to multiple worker threads that performs portions of * a larger task before dropping the shared pointer, triggering the * ack when all worker threads have completed. */ class PutDoneContext : public OperationDoneContext { IPendingLidTracker::Token _uncommitted; uint32_t _lid; DocIdLimit *_docIdLimit; std::shared_ptr _doc; public: PutDoneContext(std::shared_ptr token, std::shared_ptr done_callback, IPendingLidTracker::Token uncommitted, std::shared_ptr doc, uint32_t lid); ~PutDoneContext() override; void registerPutLid(DocIdLimit *docIdLimit) { _docIdLimit = docIdLimit; } }; } // namespace proton