Coverage Report

Created: 2026-03-14 20:54

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/storage/index/index_iterator.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <gen_cpp/olap_file.pb.h>
21
22
#include <variant>
23
24
#include "common/exception.h"
25
#include "common/factory_creator.h"
26
#include "runtime/runtime_state.h"
27
#include "storage/index/ann/ann_index_reader.h"
28
#include "storage/index/index_query_context.h"
29
#include "storage/index/index_reader.h"
30
#include "storage/index/inverted/inverted_index_query_type.h"
31
32
namespace doris {
33
struct AnnTopNParam;
34
}
35
36
namespace doris::segment_v2 {
37
38
class InvertedIndexQueryCacheHandle;
39
40
struct InvertedIndexParam;
41
using IndexParam = std::variant<InvertedIndexParam*, segment_v2::AnnTopNParam*>;
42
43
enum class AnnIndexReaderType {
44
    ANN = 0,
45
};
46
47
using IndexReaderType = std::variant<InvertedIndexReaderType, AnnIndexReaderType>;
48
class IndexIterator {
49
public:
50
2.68k
    IndexIterator() = default;
51
2.68k
    virtual ~IndexIterator() = default;
52
53
    virtual IndexReaderPtr get_reader(IndexReaderType reader_type) const = 0;
54
    virtual Status read_from_index(const IndexParam& param) = 0;
55
56
    virtual Status read_null_bitmap(InvertedIndexQueryCacheHandle* cache_handle) = 0;
57
    virtual Result<bool> has_null() = 0;
58
59
2.55k
    void set_context(const IndexQueryContextPtr& context) { _context = context; }
60
61
protected:
62
    IndexQueryContextPtr _context = nullptr;
63
};
64
65
} // namespace doris::segment_v2