MCPcopy Create free account
hub / github.com/apache/impala / AssignmentCtx

Method AssignmentCtx

be/src/scheduling/scheduler.cc:1597–1609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1595}
1596
1597Scheduler::AssignmentCtx::AssignmentCtx(const ExecutorGroup& executor_group,
1598 IntCounter* total_assignments, IntCounter* total_local_assignments, std::mt19937* rng)
1599 : executor_group_(executor_group),
1600 first_unused_executor_idx_(0),
1601 total_assignments_(total_assignments),
1602 total_local_assignments_(total_local_assignments) {
1603 DCHECK_GT(executor_group.NumExecutors(), 0);
1604 random_executor_order_ = executor_group.GetAllExecutorIps();
1605 std::shuffle(random_executor_order_.begin(), random_executor_order_.end(), *rng);
1606 // Initialize inverted map for executor rank lookups
1607 int i = 0;
1608 for (const IpAddr& ip : random_executor_order_) random_executor_rank_[ip] = i++;
1609}
1610
1611const IpAddr* Scheduler::AssignmentCtx::SelectExecutorFromCandidates(
1612 const std::vector<IpAddr>& data_locations, bool break_ties_by_rank) {

Callers

nothing calls this directly

Calls 5

shuffleFunction · 0.85
NumExecutorsMethod · 0.80
GetAllExecutorIpsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected