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

Method handle_command

src/adapter/src/coord/command_handler.rs:117–597  ·  view source on GitHub ↗

BOXED FUTURE: As of Nov 2023 the returned Future from this function was 58KB. This would get stored on the stack which is bad for runtime performance, and blow up our stack usage. Because of that we purposefully move this Future onto the heap (i.e. Box it).

(&mut self, mut cmd: Command)

Source from the content-addressed store, hash-verified

115 /// get stored on the stack which is bad for runtime performance, and blow up our stack usage.
116 /// Because of that we purposefully move this Future onto the heap (i.e. Box it).
117 pub(crate) fn handle_command(&mut self, mut cmd: Command) -> LocalBoxFuture<'_, ()> {
118 async move {
119 if let Some(session) = cmd.session_mut() {
120 session.apply_external_metadata_updates();
121 }
122 match cmd {
123 Command::Startup {
124 tx,
125 user,
126 conn_id,
127 secret_key,
128 uuid,
129 client_ip,
130 application_name,
131 notice_tx,
132 } => {
133 // Note: We purposefully do not use a ClientTransmitter here because startup
134 // handles errors and cleanup of sessions itself.
135 self.handle_startup(
136 tx,
137 user,
138 conn_id,
139 secret_key,
140 uuid,
141 client_ip,
142 application_name,
143 notice_tx,
144 )
145 .await;
146 }
147
148 Command::AuthenticatePassword {
149 tx,
150 role_name,
151 password,
152 } => {
153 self.handle_authenticate_password(tx, role_name, password)
154 .await;
155 }
156
157 Command::AuthenticateGetSASLChallenge {
158 tx,
159 role_name,
160 nonce,
161 } => {
162 self.handle_generate_sasl_challenge(tx, role_name, nonce)
163 .await;
164 }
165
166 Command::AuthenticateVerifySASLProof {
167 tx,
168 role_name,
169 proof,
170 mock_hash,
171 auth_message,
172 } => {
173 self.handle_authenticate_verify_sasl_proof(
174 tx,

Callers 1

message_commandMethod · 0.45

Calls 15

cloneFunction · 0.85
spawnFunction · 0.85
preflightFunction · 0.85
handle_startupMethod · 0.80
handle_role_can_loginMethod · 0.80
handle_executeMethod · 0.80
setup_copy_from_stdinMethod · 0.80
retire_executionMethod · 0.80

Tested by

no test coverage detected