aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/tlssyncer.h
blob: ccb706c59b79cc0de06951bba93dcd173fa704f1 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "itlssyncer.h"

namespace vespalib { class ThreadExecutor; }
namespace search::transactionlog { class SyncProxy; }

namespace proton {

class IGetSerialNum;

/**
 * Class for syncing transaction log server in a safe manner.  The
 * serial number is retrieved by running a task in the document db
 * master thread to ensure that it reflects changes performed to data
 * structures as of now.
 */
class TlsSyncer : public ITlsSyncer
{
    vespalib::ThreadExecutor &_executor;
    const IGetSerialNum &_getSerialNum;
    search::transactionlog::SyncProxy &_proxy;
public:
    virtual ~TlsSyncer() = default;

    TlsSyncer(vespalib::ThreadExecutor &executor,
              const IGetSerialNum &getSerialNum,
              search::transactionlog::SyncProxy &proxy);

    void sync() override;
};

}