blob: 3a12ae577bdb68ca9c45209204624c17cc955574 (
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 Vespa.ai. 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 {
class ILidCommitState;
/**
* 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;
const ILidCommitState *_pendingLidsForCommit;
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 ILidCommitState *);
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; }
bool lidNeedsCommit(search::DocumentIdT lid) const;
void clear();
};
}
|