MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / SeekToFirst

Method SeekToFirst

src/tablet/combine_iterator.cc:37–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 cur_qit_(nullptr) {}
36
37void CombineIterator::SeekToFirst() {
38 q_its_.erase(std::remove_if(q_its_.begin(), q_its_.end(),
39 [](const QueryIt& q_it) {
40 return !q_it.table || !q_it.it;
41 }),
42 q_its_.end());
43 if (q_its_.empty()) {
44 return;
45 }
46 if (st_type_ == ::fedb::api::GetType::kSubKeyEq) {
47 st_type_ = ::fedb::api::GetType::kSubKeyLe;
48 }
49 if (!::fedb::api::GetType_IsValid(st_type_)) {
50 PDLOG(WARNING, "invalid st type %s",
51 ::fedb::api::GetType_Name(st_type_).c_str());
52 q_its_.clear();
53 return;
54 }
55 for (auto& q_it : q_its_) {
56 if (st_ > 0) {
57 if (expire_cnt_ == 0) {
58 Seek(q_it.it.get(), st_, st_type_);
59 } else {
60 switch (ttl_type_) {
61 case ::fedb::storage::TTLType::kAbsoluteTime:
62 Seek(q_it.it.get(), st_, st_type_);
63 break;
64 case ::fedb::storage::TTLType::kAbsAndLat:
65 if (!SeekWithCount(q_it.it.get(), st_, st_type_,
66 expire_cnt_, &q_it.iter_pos)) {
67 Seek(q_it.it.get(), st_, st_type_);
68 }
69 break;
70 default:
71 SeekWithCount(q_it.it.get(), st_, st_type_, expire_cnt_,
72 &q_it.iter_pos);
73 break;
74 }
75 }
76 } else {
77 q_it.it->SeekToFirst();
78 }
79 }
80 SelectIterator();
81}
82
83void CombineIterator::SelectIterator() {
84 uint64_t max_ts = 0;

Callers 9

RunGetTimeIndexAssertFunction · 0.45
RunGetLatestIndexAssertFunction · 0.45
SeekWithCountFunction · 0.45
SeekFunction · 0.45
GetMethod · 0.45
ScanIndexMethod · 0.45
CountIndexMethod · 0.45
TraverseMethod · 0.45
ProcessQueryMethod · 0.45

Calls 6

SeekFunction · 0.85
SeekWithCountFunction · 0.85
eraseMethod · 0.80
clearMethod · 0.80
emptyMethod · 0.45
getMethod · 0.45

Tested by 2

RunGetTimeIndexAssertFunction · 0.36
RunGetLatestIndexAssertFunction · 0.36