aboutsummaryrefslogtreecommitdiffstats
path: root/storageserver/src/vespa/storageserver/app/distributorprocess.h
blob: 2eeb037207e7ca66ed073cf9adc568288bc6f801 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * \class storage::DistributorProcess
 *
 * \brief A process running a distributor.
 */

#pragma once

#include "process.h"
#include <vespa/storage/storageserver/distributornode.h>

namespace storage {

class IStorageChainBuilder;

class DistributorProcess final : public Process {
    DistributorNodeContext _context;
    uint32_t _num_distributor_stripes;
    DistributorNode::UP _node;
    config::ConfigHandle<vespa::config::content::core::StorDistributormanagerConfig>::UP
            _distributorConfigHandler;
    config::ConfigHandle<vespa::config::content::core::StorVisitordispatcherConfig>::UP
            _visitDispatcherConfigHandler;
    std::unique_ptr<IStorageChainBuilder> _storage_chain_builder;

public:
    explicit DistributorProcess(const config::ConfigUri & configUri);
    ~DistributorProcess() override;

    void shutdown() override;
    void setupConfig(vespalib::duration subscribeTimeout) override;
    void createNode() override;
    bool configUpdated() override;
    void updateConfig() override;
    StorageNode& getNode() override { return *_node; }
    StorageNodeContext& getContext() override { return _context; }
    std::string getComponentName() const override { return "distributor"; }

    virtual DistributorNodeContext& getDistributorContext() { return _context; }
    void set_storage_chain_builder(std::unique_ptr<IStorageChainBuilder> builder);
};

} // storage