aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/documentmetastore/document_meta_store_adapter.h
blob: a4f744df6f9d16f3a00c6bf38dd23794f4a4f96f (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 Yahoo. 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