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

Method render

src/storage/src/source/sql_server.rs:107–230  ·  view source on GitHub ↗
(
        self,
        scope: Scope<'scope, Lsn>,
        config: &RawSourceCreationConfig,
        resume_uppers: impl futures::Stream<Item = Antichain<Lsn>> + 'static,
        _start_signal: impl F

Source from the content-addressed store, hash-verified

105 const STATUS_NAMESPACE: StatusNamespace = StatusNamespace::SqlServer;
106
107 fn render<'scope>(
108 self,
109 scope: Scope<'scope, Lsn>,
110 config: &RawSourceCreationConfig,
111 resume_uppers: impl futures::Stream<Item = Antichain<Lsn>> + 'static,
112 _start_signal: impl Future<Output = ()> + 'static,
113 ) -> (
114 // Timely Collection for each Source Export defined in the provided `config`.
115 BTreeMap<GlobalId, StackedCollection<'scope, Lsn, Result<SourceMessage, DataflowError>>>,
116 StreamVec<'scope, Lsn, HealthStatusMessage>,
117 StreamVec<'scope, Lsn, Probe<Lsn>>,
118 Vec<PressOnDropButton>,
119 ) {
120 // Collect the source outputs that we will be exporting.
121 let mut source_outputs = BTreeMap::new();
122 for (idx, (id, export)) in config.source_exports.iter().enumerate() {
123 let SourceExport {
124 details,
125 storage_metadata,
126 data_config: _,
127 } = export;
128
129 let details = match details {
130 SourceExportDetails::SqlServer(details) => details,
131 // This is an export that doesn't need any data output to it.
132 SourceExportDetails::None => continue,
133 other => unreachable!("unexpected source export details: {other:?}"),
134 };
135
136 let decoder = details
137 .table
138 .decoder(&storage_metadata.relation_desc)
139 .expect("TODO handle errors");
140 let upstream_desc = Arc::new(details.table.clone());
141 let resume_upper = config
142 .source_resume_uppers
143 .get(id)
144 .expect("missing resume upper")
145 .iter()
146 .map(Lsn::decode_row);
147
148 let output_info = SourceOutputInfo {
149 capture_instance: Arc::clone(&details.capture_instance),
150 upstream_desc,
151 decoder: Arc::new(decoder),
152 resume_upper: Antichain::from_iter(resume_upper),
153 partition_index: u64::cast_from(idx),
154 initial_lsn: details.initial_lsn,
155 };
156 source_outputs.insert(*id, output_info);
157 }
158
159 let metrics = config
160 .metrics
161 .get_sql_server_source_metrics(config.id, config.worker_id);
162
163 let (repl_updates, repl_errs, repl_token) = replication::render(
164 scope.clone(),

Callers

nothing calls this directly

Calls 15

cloneFunction · 0.85
enumerateMethod · 0.80
expectMethod · 0.80
as_collectionMethod · 0.80
display_with_causesMethod · 0.80
renderFunction · 0.50
iterMethod · 0.45
decoderMethod · 0.45
cloneMethod · 0.45
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected