Skip to content

Commit

Permalink
raft: add adl specialization for vote_reply
Browse files Browse the repository at this point in the history
Signed-off-by: Noah Watkins <noah@redpanda.com>
  • Loading branch information
dotnwat committed Jul 6, 2022
1 parent 4cb1e24 commit e975c1c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/v/raft/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -786,4 +786,23 @@ struct adl<raft::vote_request> {
};
}
};

template<>
struct adl<raft::vote_reply> {
void to(iobuf& out, raft::vote_reply&& r) {
serialize(out, r.target_node_id, r.term, r.granted, r.log_ok);
}
raft::vote_reply from(iobuf_parser& in) {
auto target_node_id = adl<raft::vnode>{}.from(in);
auto term = adl<model::term_id>{}.from(in);
auto granted = adl<bool>{}.from(in);
auto log_ok = adl<bool>{}.from(in);
return {
.target_node_id = target_node_id,
.term = term,
.granted = granted,
.log_ok = log_ok,
};
}
};
} // namespace reflection

0 comments on commit e975c1c

Please sign in to comment.