aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/flushhandlerproxy.cpp
blob: 3456d8d7c1a6e7ee6fd7fac2505d39eb2ef99df1 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "flushhandlerproxy.h"
#include "documentdb.h"

using searchcorespi::IFlushTarget;

namespace proton {

FlushHandlerProxy::FlushHandlerProxy(const DocumentDB::SP &documentDB)
    : IFlushHandler(documentDB->getDocTypeName().toString()),
      _documentDB(documentDB),
      _retainGuard(_documentDB->retain())
{ }


FlushHandlerProxy::~FlushHandlerProxy() = default;


std::vector<IFlushTarget::SP>
FlushHandlerProxy::getFlushTargets()
{
    return _documentDB->getFlushTargets();
}


IFlushHandler::SerialNum
FlushHandlerProxy::getCurrentSerialNumber() const
{
    return _documentDB->getCurrentSerialNumber();
}


void
FlushHandlerProxy::flushDone(SerialNum flushedSerial)
{
    _documentDB->flushDone(flushedSerial);
}


void
FlushHandlerProxy::syncTls(SerialNum syncTo)
{
    _documentDB->sync(syncTo);
}


} // namespace proton