blob: e03f95af476ec06891df73f9120ec07088628d37 (
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 Vespa.ai. 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
|