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

#pragma once

#include "tls_replay_progress.h"
#include <vespa/searchlib/transactionlog/common.h>
#include <vespa/searchlib/transactionlog/client_common.h>
#include <vespa/vespalib/util/gate.h>

namespace proton {
/**
 * Wrapper of transaction log packet to use when handing over to
 * executor thread.
 */
struct PacketWrapper {
    using SP = std::shared_ptr<PacketWrapper>;

    const search::transactionlog::Packet &packet;
    TlsReplayProgress *progress;
    search::transactionlog::client::RPC::Result result;
    vespalib::Gate gate;

    PacketWrapper(const search::transactionlog::Packet &p, TlsReplayProgress *progress_) noexcept
        : packet(p),
          progress(progress_),
          result(search::transactionlog::client::RPC::ERROR),
          gate()
    {
    }
};

}  // namespace proton