MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_offset_key

Function parse_offset_key

nodedb/src/event/cdc/consumer_group/state.rs:290–304  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

288}
289
290fn parse_offset_key(key: &str) -> Option<(u64, String, String, u32)> {
291 let parts: Vec<&str> = key.splitn(4, ':').collect();
292 if parts.len() == 4 {
293 let tenant = parts[0].parse().ok()?;
294 let partition = parts[3].parse().ok()?;
295 Some((
296 tenant,
297 parts[1].to_string(),
298 parts[2].to_string(),
299 partition,
300 ))
301 } else {
302 None
303 }
304}
305
306#[cfg(test)]
307mod tests {

Callers 1

openMethod · 0.85

Calls 5

collectMethod · 0.80
to_stringMethod · 0.80
lenMethod · 0.45
okMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected