Returns the export description for the given export ID, if it exists. This function searches through the command history to find the most recent RunSinkCommand for the specified export ID and returns its description. Returns None if no ingestion with the given ID is found.
(
&self,
id: &GlobalId,
)
| 621 | /// its description. Returns None if no ingestion with the given ID is |
| 622 | /// found. |
| 623 | pub fn get_export_description( |
| 624 | &self, |
| 625 | id: &GlobalId, |
| 626 | ) -> Option<StorageSinkDesc<CollectionMetadata>> { |
| 627 | if !self.active_exports.contains_key(id) { |
| 628 | return None; |
| 629 | } |
| 630 | |
| 631 | self.history.iter().rev().find_map(|command| { |
| 632 | if let StorageCommand::RunSink(sink) = command { |
| 633 | if &sink.id == id { |
| 634 | Some(sink.description.clone()) |
| 635 | } else { |
| 636 | None |
| 637 | } |
| 638 | } else { |
| 639 | None |
| 640 | } |
| 641 | }) |
| 642 | } |
| 643 | |
| 644 | /// Updates internal state based on incoming compaction commands. |
| 645 | fn absorb_compaction(&mut self, id: GlobalId, frontier: Antichain<Timestamp>) { |
no test coverage detected