blob: 6bba7d115268c356587e381424ba06d250646cfc (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_document_meta_store.h"
namespace proton {
/**
* Class that maps functions in IDocumentMetaStore that also are found
* in search::AttributeVector to functions that DocumentMetaStore can implement.
*/
class DocumentMetaStoreAdapter : public IDocumentMetaStore
{
protected:
virtual void doCommit(const CommitParam & param) = 0;
virtual DocId doGetCommittedDocIdLimit() const = 0;
virtual void doRemoveAllOldGenerations() = 0;
virtual uint64_t doGetCurrentGeneration() const = 0;
public:
void commit(const CommitParam & param) override {
doCommit(param);
}
DocId getCommittedDocIdLimit() const override {
return doGetCommittedDocIdLimit();
}
void reclaim_unused_memory() override {
doRemoveAllOldGenerations();
}
uint64_t getCurrentGeneration() const override {
return doGetCurrentGeneration();
}
};
} // namespace proton
|