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

Method join

nodedb/src/event/cdc/consumer_group/assignment.rs:74–88  ·  view source on GitHub ↗

Register a consumer joining a group. Triggers rebalance.

(&self, tenant_id: u64, stream: &str, group: &str, consumer_id: &str)

Source from the content-addressed store, hash-verified

72
73 /// Register a consumer joining a group. Triggers rebalance.
74 pub fn join(&self, tenant_id: u64, stream: &str, group: &str, consumer_id: &str) {
75 let key = (tenant_id, stream.to_string(), group.to_string());
76 let mut groups = self.groups.write().unwrap_or_else(|p| p.into_inner());
77 let state = groups.entry(key).or_insert_with(GroupAssignment::new);
78 state.consumers.insert(consumer_id.to_string());
79 state.rebalance();
80
81 tracing::debug!(
82 stream,
83 group,
84 consumer_id,
85 total_consumers = state.consumers.len(),
86 "consumer joined, rebalanced"
87 );
88 }
89
90 /// Deregister a consumer leaving a group. Triggers rebalance.
91 pub fn leave(&self, tenant_id: u64, stream: &str, group: &str, consumer_id: &str) {

Callers 15

coords_to_wktFunction · 0.80
concurrent_reservesFunction · 0.80
wal_append_fsync_1kFunction · 0.80
wal_append_only_10kFunction · 0.80
wal_group_commitFunction · 0.80
concurrent_group_commitFunction · 0.80
recover_empty_walFunction · 0.80
recover_nonexistent_fileFunction · 0.80
recover_with_recordsFunction · 0.80
recover_truncated_walFunction · 0.80

Calls 5

to_stringMethod · 0.80
entryMethod · 0.80
writeMethod · 0.45
insertMethod · 0.45
rebalanceMethod · 0.45

Tested by 15

concurrent_reservesFunction · 0.64
concurrent_group_commitFunction · 0.64
recover_empty_walFunction · 0.64
recover_nonexistent_fileFunction · 0.64
recover_with_recordsFunction · 0.64
recover_truncated_walFunction · 0.64
write_and_recoverFunction · 0.64
survives_reopenFunction · 0.64