MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / next_from_multi_range

Method next_from_multi_range

tiledb/sm/subarray/subarray_partitioner.cc:1189–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1187}
1188
1189Status SubarrayPartitioner::next_from_multi_range(bool* unsplittable) {
1190 // A new multi-range subarray may need to be put in the list and split
1191 if (state_.multi_range_.empty()) {
1192 auto s = subarray_.get_subarray(current_.start_, current_.end_);
1193 state_.multi_range_.push_front(std::move(s));
1194 throw_if_not_ok(split_top_multi_range(unsplittable));
1195 }
1196
1197 // Loop until you find a partition that fits or unsplittable
1198 if (!*unsplittable) {
1199 bool must_split;
1200 do {
1201 auto& partition = state_.multi_range_.front();
1202 must_split = this->must_split(&partition);
1203 if (must_split)
1204 RETURN_NOT_OK(split_top_multi_range(unsplittable));
1205 } while (must_split && !*unsplittable);
1206 }
1207
1208 // At this point, the top mulit-range is the next partition
1209 current_.partition_ = std::move(state_.multi_range_.front());
1210 current_.split_multi_range_ = true;
1211 state_.multi_range_.pop_front();
1212 if (state_.multi_range_.empty())
1213 state_.start_ = current_.end_ + 1;
1214
1215 return Status::Ok();
1216}
1217
1218Status SubarrayPartitioner::next_from_single_range(bool* unsplittable) {
1219 // Handle case where a new single range must be put in the list and split

Callers

nothing calls this directly

Calls 4

must_splitMethod · 0.95
throw_if_not_okFunction · 0.85
get_subarrayMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected