(&mut self, cmd: ComputeCommand)
| 443 | /// Entrypoint for applying a compute command. |
| 444 | #[mz_ore::instrument(level = "debug")] |
| 445 | pub fn handle_compute_command(&mut self, cmd: ComputeCommand) { |
| 446 | use ComputeCommand::*; |
| 447 | |
| 448 | self.compute_state.command_history.push(cmd.clone()); |
| 449 | |
| 450 | // Record the command duration, per worker and command kind. |
| 451 | let timer = self |
| 452 | .compute_state |
| 453 | .metrics |
| 454 | .handle_command_duration_seconds |
| 455 | .for_command(&cmd) |
| 456 | .start_timer(); |
| 457 | |
| 458 | match cmd { |
| 459 | Hello { .. } => panic!("Hello must be captured before"), |
| 460 | CreateInstance(instance_config) => self.handle_create_instance(*instance_config), |
| 461 | InitializationComplete => (), |
| 462 | UpdateConfiguration(params) => self.handle_update_configuration(*params), |
| 463 | CreateDataflow(dataflow) => self.handle_create_dataflow(*dataflow), |
| 464 | Schedule(id) => self.handle_schedule(id), |
| 465 | AllowCompaction { id, frontier } => self.handle_allow_compaction(id, frontier), |
| 466 | Peek(peek) => { |
| 467 | peek.otel_ctx.attach_as_parent(); |
| 468 | self.handle_peek(*peek) |
| 469 | } |
| 470 | CancelPeek { uuid } => self.handle_cancel_peek(uuid), |
| 471 | AllowWrites(id) => { |
| 472 | self.handle_allow_writes(id); |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | timer.observe_duration(); |
| 477 | } |
| 478 | |
| 479 | fn handle_create_instance(&mut self, config: InstanceConfig) { |
| 480 | // Seed the worker configuration with the controller's snapshot before applying it, so |
no test coverage detected