MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / dispatch_meta

Method dispatch_meta

nodedb/src/data/executor/dispatch/meta.rs:13–202  ·  view source on GitHub ↗
(
        &mut self,
        task: &ExecutionTask,
        tid: u64,
        op: &MetaOp,
    )

Source from the content-addressed store, hash-verified

11
12impl CoreLoop {
13 pub(super) fn dispatch_meta(
14 &mut self,
15 task: &ExecutionTask,
16 tid: u64,
17 op: &MetaOp,
18 ) -> Response {
19 match op {
20 MetaOp::WalAppend { payload } => self.execute_wal_append(task, payload),
21
22 MetaOp::Cancel { target_request_id } => self.execute_cancel(task, *target_request_id),
23
24 MetaOp::TransactionBatch { plans } => self.execute_transaction_batch(task, tid, plans),
25
26 MetaOp::CreateSnapshot => self.execute_create_snapshot(task),
27 MetaOp::Compact => self.execute_compact(task),
28 MetaOp::Checkpoint => self.execute_checkpoint(task),
29
30 MetaOp::RegisterContinuousAggregate { def } => {
31 self.continuous_agg_mgr.register(def.clone());
32 tracing::info!(
33 name = def.name,
34 source = def.source,
35 interval = def.bucket_interval,
36 "continuous aggregate registered"
37 );
38 self.response_ok(task)
39 }
40
41 MetaOp::UnregisterContinuousAggregate { name } => {
42 self.continuous_agg_mgr.unregister(name);
43 tracing::info!(name, "continuous aggregate unregistered");
44 self.response_ok(task)
45 }
46
47 MetaOp::ListContinuousAggregates => {
48 let infos = self.continuous_agg_mgr.list_aggregates();
49 match response_codec::encode_serde(&infos) {
50 Ok(payload) => self.response_with_payload(task, payload),
51 Err(e) => self.response_error(
52 task,
53 crate::bridge::envelope::ErrorCode::Internal {
54 detail: e.to_string(),
55 },
56 ),
57 }
58 }
59
60 MetaOp::CreateTenantSnapshot { tenant_id } => {
61 self.execute_create_tenant_snapshot(task, *tenant_id)
62 }
63
64 MetaOp::RestoreTenantSnapshot {
65 tenant_id,
66 snapshot,
67 } => self.execute_restore_tenant_snapshot(task, *tenant_id, snapshot),
68
69 MetaOp::ConvertCollection {
70 collection,

Callers 1

metaMethod · 0.80

Calls 15

encode_serdeFunction · 0.85
execute_wal_appendMethod · 0.80
execute_cancelMethod · 0.80
execute_compactMethod · 0.80
execute_checkpointMethod · 0.80
response_okMethod · 0.80
list_aggregatesMethod · 0.80
response_with_payloadMethod · 0.80
response_errorMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected