aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/test/dummydbowner.h
blob: 6e9fb120589a4aa8d494ad0c9af680c5584c08e1 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchcore/proton/server/idocumentdbowner.h>
#include <vespa/vespalib/stllike/string.h>

namespace proton {

struct DummyDBOwner : IDocumentDBOwner {
    std::shared_ptr<IDocumentDBReferenceRegistry> _registry;
    std::unique_ptr<SessionManager> _sessionManager;

    DummyDBOwner();
    ~DummyDBOwner() override;

    bool isInitializing() const override { return false; }

    uint32_t getDistributionKey() const override { return -1; }
    uint32_t getNumThreadsPerSearch() const override { return 1; }
    std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override;
    SessionManager & session_manager() override;
};

} // namespace proton