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

#include <vespa/searchcore/proton/flushengine/iflushstrategy.h>

namespace proton {

class SimpleFlush : public IFlushStrategy
{
private:
    using IFlushTarget = searchcorespi::IFlushTarget;
    class CompareTarget {
    public:
        bool operator () (const FlushContext::SP &lhs, const FlushContext::SP &rhs) const {
            return compare(*lhs->getTarget(), *rhs->getTarget());
        }
    private:
        bool compare(const IFlushTarget & lhs, const IFlushTarget & rhs) const;
    };
public:
    SimpleFlush();

    // Implements IFlushStrategy
    virtual FlushContext::List getFlushTargets(const FlushContext::List& targetList,
                                               const flushengine::TlsStatsMap&,
                                               const flushengine::ActiveFlushStats&) const override;

};

} // namespace proton