Skip to main content

encode_fetch_snapshot_answer

Function encode_fetch_snapshot_answer 

Source
pub fn encode_fetch_snapshot_answer(
    top_level_error: i16,
    partition: Option<FetchSnapshotPartition>,
    leader: &QuorumLeader,
    version: i16,
) -> Bytes
Expand description

Encodes a FetchSnapshot response body (api 59) at version, as Kafka’s RaftUtil.singletonFetchSnapshotResponse builds it.

partition None is Kafka’s bare top-level error response, FetchSnapshotResponse.withTopLevelError. Otherwise NodeEndpoints names the leader when the leader and its endpoint are known.