summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/removedonecontext.h
blob: 62db0f20b845620426fafafdf19c8be5b29b1110 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "operationdonecontext.h"
#include <vespa/searchcore/proton/common/ipendinglidtracker.h>

namespace proton {

/**
 * Context class for document removes that acks remove
 * 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 RemoveDoneContext : public OperationDoneContext
{
    IPendingLidTracker::Token _uncommitted;

public:
    RemoveDoneContext(std::shared_ptr<feedtoken::IState>, std::shared_ptr<vespalib::IDestructorCallback> done_callback, IPendingLidTracker::Token uncommitted);
    ~RemoveDoneContext() override;
};

}  // namespace proton