summaryrefslogtreecommitdiffstats
path: root/storageserver/src/vespa/storageserver/app/servicelayerprocess.h
blob: dd22be8f7c7960686a91edb7e252ba98feaf0dcf (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
45
46
47
48
49
50
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * \class storage::ServiceLayerProcess
 *
 * \brief A process running a service layer.
 */
/**
 * \class storage::MemFileServiceLayerProcess
 *
 * \brief A process running a service layer with memfile persistence provider.
 */
/**
 * \class storage::RpcServiceLayerProcess
 *
 * \brief A process running a service layer with RPC persistence provider.
 */
#pragma once

#include <vespa/storageserver/app/process.h>
#include <vespa/config/config.h>
#include <vespa/config/helper/configfetcher.h>
#include <vespa/config-persistence.h>

namespace storage {

class ServiceLayerProcess : public Process {
    VisitorFactory::Map _externalVisitors;
    ServiceLayerNode::UP _node;

protected:
    ServiceLayerNodeContext _context;

public:
    ServiceLayerProcess(const config::ConfigUri & configUri);

    virtual void shutdown() override;

    virtual void setupProvider() = 0;
    virtual spi::PersistenceProvider& getProvider() = 0;

    virtual void createNode() override;

    virtual StorageNode& getNode() override { return *_node; }
    virtual StorageNodeContext& getContext() override { return _context; }

    virtual std::string getComponentName() const override { return "servicelayer"; }
};

} // storage