(&self, group_id: u64, entries: &[LogEntry])
| 67 | |
| 68 | impl nodedb_cluster::CommitApplier for CalvinApplier { |
| 69 | fn apply_committed(&self, group_id: u64, entries: &[LogEntry]) -> u64 { |
| 70 | if group_id == SEQUENCER_GROUP_ID { |
| 71 | let mut sm = self.state_machine.lock().unwrap_or_else(|p| p.into_inner()); |
| 72 | for entry in entries { |
| 73 | if !entry.data.is_empty() { |
| 74 | sm.apply(&entry.data); |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | entries.last().map(|e| e.index).unwrap_or(0) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /// A cluster test node extended with sequencer Raft group support. |