aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/bmcluster/storage_api_message_bus_bm_feed_handler.h
blob: 2d72c6b4d09b008593e0d068eeebe2eb5e1b76dd (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 "storage_api_bm_feed_handler_base.h"
#include "bm_message_bus_routes.h"
#include <atomic>

namespace storage::api { class StorageCommand; }

namespace search::bmcluster {

class BmMessageBus;
class IBmDistribution;

/*
 * Benchmark feed handler for feed to service layer or distributor
 * using storage api protocol over message bus.
 */
class StorageApiMessageBusBmFeedHandler : public StorageApiBmFeedHandlerBase
{
    BmMessageBus&          _message_bus;
    BmMessageBusRoutes     _routes;
    std::atomic<uint32_t>  _no_route_error_count;
    void send_cmd(std::shared_ptr<storage::api::StorageCommand> cmd, PendingTracker& tracker) override;
public:
    StorageApiMessageBusBmFeedHandler(BmMessageBus &message_bus, const IBmDistribution& distribution, bool distributor);
    ~StorageApiMessageBusBmFeedHandler();
    void attach_bucket_info_queue(PendingTracker &tracker) override;
    uint32_t get_error_count() const override;
};

}