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

Function flush_ilp_batch

nodedb/src/control/server/ilp_batch.rs:73–85  ·  view source on GitHub ↗

Dispatch an ILP batch to the Data Plane with series-aware routing. Groups lines by `(measurement, sorted_tags)` hash to route each series to a deterministic core. This eliminates cross-core contention: each core owns a subset of series. For batches with a single measurement (common case), all lines go to one dispatch — no overhead from grouping.

(
    state: &SharedState,
    tenant_id: TenantId,
    batch: &str,
)

Source from the content-addressed store, hash-verified

71/// For batches with a single measurement (common case), all lines go to
72/// one dispatch — no overhead from grouping.
73pub(super) async fn flush_ilp_batch(
74 state: &SharedState,
75 tenant_id: TenantId,
76 batch: &str,
77) -> crate::Result<u64> {
78 // Quota enforcement — reject before WAL append or dispatch.
79 state.check_tenant_quota(tenant_id)?;
80 state.tenant_request_start(tenant_id);
81
82 let result = flush_ilp_batch_inner(state, tenant_id, batch).await;
83 state.tenant_request_end(tenant_id);
84 result
85}
86
87/// Inner dispatch logic for ILP batch (separated for clean quota bookkeeping).
88async fn flush_ilp_batch_inner(

Callers 1

handle_ilp_connectionFunction · 0.85

Calls 4

flush_ilp_batch_innerFunction · 0.85
check_tenant_quotaMethod · 0.80
tenant_request_startMethod · 0.80
tenant_request_endMethod · 0.80

Tested by

no test coverage detected