| 382 | } |
| 383 | |
| 384 | Status SubarrayPartitioner::next(bool* unsplittable) { |
| 385 | auto timer_se = stats_->start_timer("read_next_partition"); |
| 386 | |
| 387 | *unsplittable = false; |
| 388 | |
| 389 | if (done()) |
| 390 | return Status::Ok(); |
| 391 | |
| 392 | // Handle single range partitions, remaining from previous iteration |
| 393 | if (!state_.single_range_.empty()) |
| 394 | return next_from_single_range(unsplittable); |
| 395 | |
| 396 | // Handle multi-range partitions, remaining from slab splits |
| 397 | if (!state_.multi_range_.empty()) |
| 398 | return next_from_multi_range(unsplittable); |
| 399 | |
| 400 | // Find the [start, end] of the subarray ranges that fit in the budget |
| 401 | bool interval_found; |
| 402 | RETURN_NOT_OK(compute_current_start_end(&interval_found)); |
| 403 | |
| 404 | // Single-range partition that must be split |
| 405 | // Note: this applies only to UNORDERED and GLOBAL_ORDER layouts, |
| 406 | // since otherwise we may have to calibrate the range start and end |
| 407 | if (!interval_found && (subarray_.layout() == Layout::UNORDERED || |
| 408 | subarray_.layout() == Layout::GLOBAL_ORDER)) |
| 409 | return next_from_single_range(unsplittable); |
| 410 | |
| 411 | // An interval of whole ranges that may need calibration |
| 412 | bool must_split_slab; |
| 413 | RETURN_NOT_OK(calibrate_current_start_end(&must_split_slab)); |
| 414 | |
| 415 | // Handle case the next partition is composed of whole ND ranges |
| 416 | if (interval_found && !must_split_slab) { |
| 417 | current_.partition_ = |
| 418 | subarray_.get_subarray(current_.start_, current_.end_); |
| 419 | current_.split_multi_range_ = false; |
| 420 | state_.start_ = current_.end_ + 1; |
| 421 | return Status::Ok(); |
| 422 | } |
| 423 | |
| 424 | // Must split a multi-range subarray slab |
| 425 | return next_from_multi_range(unsplittable); |
| 426 | } |
| 427 | |
| 428 | Status SubarrayPartitioner::set_result_budget( |
| 429 | const char* name, uint64_t budget) { |
nothing calls this directly
no test coverage detected