Skip to content

Commit 1a870a8

Browse files
committed
Small code simplification
1 parent 38cd299 commit 1a870a8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

quickwit/quickwit-control-plane/src/indexing_scheduler/scheduling/scheduling_logic.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,14 @@ fn place_unassigned_shards_single_source(
411411
for PlacementCandidate {
412412
indexer_ord,
413413
available_capacity,
414+
current_num_shards,
414415
..
415416
} in sorted_candidates
416417
{
417-
let current_num_shards_for_indexer_and_source = *solution.indexer_assignments[*indexer_ord]
418-
.num_shards_per_source
419-
.get(&source.source_ord)
420-
.unwrap_or(&0);
421418
let num_placable_shards_for_available_capacity =
422419
available_capacity.cpu_millis() / source.load_per_shard;
423-
let num_placable_shards_for_limit = limit_num_shards_per_indexer_per_source
424-
.saturating_sub(current_num_shards_for_indexer_and_source);
420+
let num_placable_shards_for_limit =
421+
limit_num_shards_per_indexer_per_source.saturating_sub(*current_num_shards);
425422
let num_shards_to_place = num_shards
426423
.min(num_placable_shards_for_available_capacity)
427424
.min(num_placable_shards_for_limit);

0 commit comments

Comments
 (0)