blob: c3ff871735fd48b851c333ec09d8942193f40e85 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "flushtask.h"
#include "flushengine.h"
namespace proton {
FlushTask::FlushTask(uint32_t taskId,
FlushEngine &engine,
std::shared_ptr<FlushContext> ctx)
: _taskId(taskId),
_engine(engine),
_context(std::move(ctx))
{
assert(_context);
}
FlushTask::~FlushTask()
{
_engine.flushDone(*_context, _taskId);
}
void
FlushTask::run()
{
searchcorespi::FlushTask::UP task(_context->getTask());
search::SerialNum flushSerial(task->getFlushSerial());
if (flushSerial != 0) {
_context->getHandler()->syncTls(flushSerial);
}
task->run();
task.reset();
}
} // namespace proton
|