aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h
blob: 9dc1fbdd9f6319123212301a962acaf5f509e6a0 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/searchcorespi/index/iindexmanager.h>

namespace proton {

namespace test {

/**
 * Mock of the IIndexManager interface used for unit testing.
 */
struct MockIndexManager : public searchcorespi::IIndexManager
{
    virtual void putDocument(uint32_t, const Document &, SerialNum) override {}
    virtual void removeDocument(uint32_t, SerialNum) override {}
    virtual void commit(SerialNum, OnWriteDoneType) override {}
    virtual SerialNum getCurrentSerialNum() const override { return 0; }
    virtual SerialNum getFlushedSerialNum() const override { return 0; }
    virtual searchcorespi::IndexSearchable::SP getSearchable() const override {
        return searchcorespi::IndexSearchable::SP();
    }
    virtual search::SearchableStats getSearchableStats() const override {
        return search::SearchableStats();
    }
    virtual searchcorespi::IFlushTarget::List getFlushTargets() override {
        return searchcorespi::IFlushTarget::List();
    }
    virtual void setSchema(const Schema &, SerialNum) override {}
    virtual void heartBeat(SerialNum) override {}
    void compactLidSpace(uint32_t, SerialNum) override {}
    virtual void setMaxFlushed(uint32_t) override { }
};

} // namespace test

} // namespace proton