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

Method handle_compute_command

src/compute/src/compute_state.rs:445–477  ·  view source on GitHub ↗
(&mut self, cmd: ComputeCommand)

Source from the content-addressed store, hash-verified

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

Callers 1

handle_commandMethod · 0.80

Calls 12

attach_as_parentMethod · 0.80
handle_peekMethod · 0.80
handle_cancel_peekMethod · 0.80
handle_allow_writesMethod · 0.80
pushMethod · 0.45
cloneMethod · 0.45
for_commandMethod · 0.45
handle_scheduleMethod · 0.45

Tested by

no test coverage detected