Skip to content

Commit

Permalink
WIP c/leader_balancer: reorder class fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlpn committed Oct 1, 2024
1 parent b0457df commit 4c6f6f0
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/v/cluster/scheduling/leader_balancer.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,6 @@ class leader_balancer {

config::binding<model::leaders_preference> _default_preference;

struct last_known_leader {
model::broker_shard shard;
clock_type::time_point expires;
};
absl::btree_map<raft::group_id, last_known_leader> _last_leader;

leader_balancer_probe _probe;
bool _need_controller_refresh{true};
bool _throttled{false};
absl::btree_map<raft::group_id, clock_type::time_point> _muted;
cluster::notification_id_type _leader_notify_handle;
std::optional<cluster::notification_id_type>
_leadership_change_notify_handle;
cluster::notification_id_type _maintenance_state_notify_handle;
topic_table& _topics;
partition_leaders_table& _leaders;
members_table& _members;
Expand All @@ -209,15 +195,33 @@ class leader_balancer {
ss::sharded<partition_manager>& _partition_manager;
ss::sharded<ss::abort_source>& _as;
consensus_ptr _raft0;

cluster::notification_id_type _leader_notify_handle;
std::optional<cluster::notification_id_type>
_leadership_change_notify_handle;
cluster::notification_id_type _maintenance_state_notify_handle;

ss::gate _gate;
ss::timer<clock_type> _timer;

struct last_known_leader {
model::broker_shard shard;
clock_type::time_point expires;
};
absl::btree_map<raft::group_id, last_known_leader> _last_leader;

bool _need_controller_refresh{true};
bool _throttled{false};
absl::btree_map<raft::group_id, clock_type::time_point> _muted;

struct in_flight_reassignment {
reassignment value;
clock_type::time_point expires;
};
absl::flat_hash_map<raft::group_id, in_flight_reassignment>
_in_flight_changes;

leader_balancer_probe _probe;
};

} // namespace cluster

0 comments on commit 4c6f6f0

Please sign in to comment.