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

Function build_request

nodedb/src/control/distributed_applier/apply_loop.rs:32–55  ·  view source on GitHub ↗

Build a `Request` for a committed write with default deadline / priority.

(
    state: &Arc<SharedState>,
    tenant_id: TenantId,
    vshard_id: VShardId,
    plan: PhysicalPlan,
    event_source: crate::event::EventSource,
)

Source from the content-addressed store, hash-verified

30
31/// Build a `Request` for a committed write with default deadline / priority.
32fn build_request(
33 state: &Arc<SharedState>,
34 tenant_id: TenantId,
35 vshard_id: VShardId,
36 plan: PhysicalPlan,
37 event_source: crate::event::EventSource,
38) -> Request {
39 Request {
40 request_id: state.next_request_id(),
41 tenant_id,
42 database_id: DatabaseId::DEFAULT,
43 vshard_id,
44 plan,
45 deadline: Instant::now() + Duration::from_secs(30),
46 priority: Priority::Normal,
47 trace_id: TraceId::generate(),
48 consistency: ReadConsistency::Strong,
49 idempotency_key: None,
50 event_source,
51 user_roles: Vec::new(),
52 user_id: None,
53 statement_digest: None,
54 }
55}
56
57/// Dispatch a request through the SPSC bridge and await its response.
58///

Callers 1

run_apply_loopFunction · 0.85

Calls 2

nowFunction · 0.85
next_request_idMethod · 0.45

Tested by

no test coverage detected