MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / get_export_description

Method get_export_description

src/storage-controller/src/instance.rs:623–642  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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>) {

Callers 1

update_schedulingMethod · 0.80

Calls 3

contains_keyMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected