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

#include "i_index_writer.h"
#include <vespa/searchcore/proton/common/feeddebugger.h>

namespace proton {

class IndexWriter : public IIndexWriter,
                    private FeedDebugger {
private:
    IIndexManager::SP _mgr;

    bool ignoreOperation(search::SerialNum serialNum) const;

public:
    IndexWriter(const IIndexManager::SP &mgr);
    ~IndexWriter();
    /**
     * Implements IIndexWriter.
     */
    virtual const IIndexManager::SP & getIndexManager() const override { return _mgr; }

    virtual void put(search::SerialNum serialNum,
                     const document::Document &doc,
                     const search::DocumentIdT lid) override;
    virtual void remove(search::SerialNum serialNum,
                        const search::DocumentIdT lid) override;
    virtual void commit(search::SerialNum serialNum,
                        OnWriteDoneType onWriteDone) override;

    virtual void
    heartBeat(search::SerialNum serialNum) override;
    void compactLidSpace(search::SerialNum serialNum, const search::DocumentIdT lid) override;
};

} // namespace proton