aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.h
blob: df82ddf1584dacec739ee7ed03a269740d7f8810 (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "ifeedview.h"
#include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h>
#include <vespa/searchcore/proton/persistenceengine/i_document_retriever.h>

namespace proton {

/**
 * The view of a document sub db as seen from the maintenance controller
 * and various maintenance jobs.
 */
class MaintenanceDocumentSubDB
{
private:
    vespalib::string       _name;
    uint32_t               _sub_db_id;
    IDocumentMetaStore::SP _meta_store;
    IDocumentRetriever::SP _retriever;
    IFeedView::SP          _feed_view;

public:
    MaintenanceDocumentSubDB();
    ~MaintenanceDocumentSubDB();

    MaintenanceDocumentSubDB(const vespalib::string& name,
                             uint32_t sub_db_id,
                             IDocumentMetaStore::SP meta_store,
                             IDocumentRetriever::SP retriever,
                             IFeedView::SP feed_view);

    const vespalib::string& name() const { return _name; }
    uint32_t sub_db_id() const { return _sub_db_id; }
    const IDocumentMetaStore::SP& meta_store() const { return _meta_store; }
    const IDocumentRetriever::SP& retriever() const { return _retriever; }
    const IFeedView::SP& feed_view() const { return _feed_view; }

    bool valid() const { return _meta_store.get() != nullptr; }
    void clear();
};

}