aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.h
blob: 1ac7b6c9c0e74545f87bd9953f5e854449cd1ab4 (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/searchlib/docstore/idocumentstore.h>
#include <vespa/searchcorespi/flush/iflushtarget.h>

namespace proton {

/**
 * This class implements the IFlushTarget interface to proxy a summary manager.
 */
class SummaryFlushTarget : public searchcorespi::LeafFlushTarget {
private:
    using FlushStats = searchcorespi::FlushStats;
    search::IDocumentStore & _docStore;
    vespalib::Executor     & _summaryService;
    FlushStats               _lastStats;

    Task::UP internalInitFlush(SerialNum currentSerial);

public:
    SummaryFlushTarget(search::IDocumentStore & docStore,
                       vespalib::Executor & summaryService);

    MemoryGain getApproxMemoryGain() const override;
    DiskGain getApproxDiskGain() const override { return DiskGain(0, 0); }
    SerialNum getFlushedSerialNum() const override;
    Time getLastFlushTime() const override;

    Task::UP initFlush(SerialNum currentSerial, std::shared_ptr<search::IFlushToken> flush_token) override;

    FlushStats getLastFlushStats() const override { return _lastStats; }
    uint64_t getApproxBytesToWriteToDisk() const override { return 0; }
};

} // namespace proton