mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Add comment & polishing
This commit is contained in:
parent
52db759c92
commit
f46acc5236
@ -35,6 +35,14 @@ std::function<Priority(size_t index)> GetPriorityForLoadBalancing::getPriorityFu
|
||||
case LoadBalancing::ROUND_ROBIN:
|
||||
auto local_last_used = last_used.fetch_add(1) % pool_size;
|
||||
|
||||
// Example: pool_size = 5
|
||||
// | local_last_used | i=0 | i=1 | i=2 | i=3 | i=4 |
|
||||
// | 0 | 4 | 0 | 1 | 2 | 3 |
|
||||
// | 1 | 3 | 4 | 0 | 1 | 2 |
|
||||
// | 2 | 2 | 3 | 4 | 0 | 1 |
|
||||
// | 3 | 1 | 2 | 3 | 4 | 0 |
|
||||
// | 4 | 0 | 1 | 2 | 3 | 4 |
|
||||
|
||||
get_priority = [pool_size, local_last_used](size_t i)
|
||||
{
|
||||
size_t priority = pool_size - 1;
|
||||
|
@ -147,7 +147,7 @@ protected:
|
||||
return std::make_tuple(shared_pool_states, nested_pools, last_error_decrease_time);
|
||||
}
|
||||
|
||||
NestedPools nested_pools;
|
||||
const NestedPools nested_pools;
|
||||
|
||||
const time_t decrease_error_period;
|
||||
const size_t max_error_cap;
|
||||
|
Loading…
Reference in New Issue
Block a user