summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/putdonecontext.cpp
blob: 7801f21c9066db8877ad67542b04f44498584644 (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
27
28
29
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "putdonecontext.h"
#include <vespa/document/fieldvalue/document.h>
#include <vespa/searchcore/proton/common/docid_limit.h>
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h>

using document::Document;

namespace proton {

PutDoneContext::PutDoneContext(IDestructorCallback::SP token, IPendingLidTracker::Token uncommitted,
                               std::shared_ptr<const Document> doc, uint32_t lid)
    : OperationDoneContext(std::move(token)),
      _uncommitted(std::move(uncommitted)),
      _lid(lid),
      _docIdLimit(nullptr),
      _doc(std::move(doc))
{
}

PutDoneContext::~PutDoneContext()
{
    if (_docIdLimit != nullptr) {
        _docIdLimit->bumpUpLimit(_lid + 1);
    }
}

}  // namespace proton