Skip to content

Commit

Permalink
utest: partition balancer planner cancelation
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeDRoman committed Jul 6, 2022
1 parent 974815d commit b0a249b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/v/cluster/tests/partition_balancer_planner_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ struct partition_balancer_planner_fixture {
}
}

cluster::move_partition_replicas_cmd make_move_partition_replicas_cmd(
model::ntp ntp, std::vector<model::broker_shard> replica_set) {
return cluster::move_partition_replicas_cmd(
std::move(ntp), std::move(replica_set));
}

void move_partition_replicas(cluster::ntp_reassignments& reassignment) {
auto cmd = make_move_partition_replicas_cmd(
reassignment.ntp,
reassignment.allocation_units.get_assignments().front().replicas);
auto res = workers.dispatcher
.apply_update(serialize_cmd(std::move(cmd)).get())
.get();
BOOST_REQUIRE_EQUAL(res, cluster::errc::success);
}

std::vector<raft::follower_metrics>
create_follower_metrics(const std::set<size_t>& unavailable_nodes = {}) {
std::vector<raft::follower_metrics> metrics;
Expand Down

0 comments on commit b0a249b

Please sign in to comment.