aboutsummaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/report-connectivity.h
blob: b0aa0784ce009f4af4303d3d5785a48af3dd7a11 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/fnet/frt/rpcrequest.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/config-model.h>
#include <vespa/config/helper/configfetcher.h>
#include "model-owner.h"
#include "peer-check.h"
#include "status-callback.h"

#include <atomic>
#include <memory>
#include <string>
#include <vector>

namespace config::sentinel {

class ReportConnectivity : public StatusCallback
{
public:
    ReportConnectivity(FRT_RPCRequest *req, int timeout_ms, FRT_Supervisor &orb, ModelOwner &modelOwner);
    virtual ~ReportConnectivity();
    void returnStatus(bool ok) override;
private:
    void finish() const;
    FRT_RPCRequest *_parentRequest;
    std::vector<std::unique_ptr<PeerCheck>> _checks;
    std::atomic<size_t> _remaining;
};

}