aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/memoryindex/invert_context.h
blob: 4d2ebddd647bd5295987e297b8056fd5de8a3d26 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "bundled_fields_context.h"

namespace search::memoryindex {

/*
 * Context used by an InvertTask to invert a set of document fields
 * into corresponding field inverters or by a RemoveTask to remove
 * documents from a set of field inverters.
 *
 * It is also used by DocumentInverter::pushDocuments() to execute
 * PushTask at the proper time (i.e. when all related InvertTask /
 * RemoveTask operations have completed).
 */
class InvertContext : public BundledFieldsContext
{
    std::vector<uint32_t> _pushers;
public:
    void add_pusher(uint32_t pusher_id);
    InvertContext(vespalib::ISequencedTaskExecutor::ExecutorId id);
    ~InvertContext();
    const std::vector<uint32_t>& get_pushers() const noexcept { return _pushers; }
};

}