pub struct TxnOffsetCommitRequest;Expand description
Java TxnOffsetCommitRequest version helpers (KIP-890 transaction V2).
Implementations§
Source§impl TxnOffsetCommitRequest
impl TxnOffsetCommitRequest
Sourcepub const LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2: i16 = 4
pub const LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2: i16 = 4
Java TxnOffsetCommitRequest.LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2.
Sourcepub fn offsets(
topics: &[TxnOffsetTopic],
) -> HashMap<(String, i32), TxnOffsetPartition>
pub fn offsets( topics: &[TxnOffsetTopic], ) -> HashMap<(String, i32), TxnOffsetPartition>
Java TxnOffsetCommitRequest.offsets.
Each (topic, partition) maps to that TxnOffsetPartition
(Java CommittedOffset). A later partition overwrites an earlier
one for the same pair (Java HashMap.put).
Sourcepub fn from_offsets<'a, I>(pending_txn_offset_commits: I) -> Vec<TxnOffsetTopic>
pub fn from_offsets<'a, I>(pending_txn_offset_commits: I) -> Vec<TxnOffsetTopic>
Java TxnOffsetCommitRequest.getTopics.
Groups (topic, CommittedOffset body) by name. A later entry
for the same topic appends (Java HashMap.getOrDefault then
partitions.add). Topic order is first-seen (Java
HashMap.entrySet order is unspecified). The Java map key is
TopicPartition; grouping uses only the name. The partition
index on the body is kept as-is. Duplicate partitions for the
same pair are kept (ArrayList).
Sourcepub fn build(
version: i16,
group_metadata_set: bool,
is_transaction_v2_enabled: bool,
) -> Result<i16>
pub fn build( version: i16, group_metadata_set: bool, is_transaction_v2_enabled: bool, ) -> Result<i16>
Java TxnOffsetCommitRequest.Builder.build.
groupMetadataSet below v3 is UnsupportedVersionException.
Encode still rejects that case; this is the Builder check.
!isTransactionV2Enabled caps the returned version at
Self::LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2. This crate
speaks 0–5. This is not Self::offsets / Self::from_offsets
/ getErrorResponse / TxnOffsetCommitMember::group_metadata_set.