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

Function put_delta

nodedb-cluster-tests/tests/array_raft_replication.rs:43–68  ·  view source on GitHub ↗
(
    array: &str,
    coord_x: i64,
    v: f64,
    schema_hlc: nodedb_array::sync::hlc::Hlc,
    ms: u64,
)

Source from the content-addressed store, hash-verified

41}
42
43fn put_delta(
44 array: &str,
45 coord_x: i64,
46 v: f64,
47 schema_hlc: nodedb_array::sync::hlc::Hlc,
48 ms: u64,
49) -> ArrayDeltaMsg {
50 let op = ArrayOp {
51 header: ArrayOpHeader {
52 array: array.to_string(),
53 hlc: hlc(ms, 1),
54 schema_hlc,
55 valid_from_ms: 0,
56 valid_until_ms: -1,
57 system_from_ms: ms as i64,
58 },
59 kind: ArrayOpKind::Put,
60 coord: vec![CoordValue::Int64(coord_x)],
61 attrs: Some(vec![CellValue::Float64(v)]),
62 };
63 let payload = op_codec::encode_op(&op).expect("encode op");
64 ArrayDeltaMsg {
65 array: array.to_string(),
66 op_payload: payload,
67 }
68}
69
70fn make_inbound(shared: &Arc<SharedState>) -> OriginArrayInbound {
71 let engine = Arc::new(OriginApplyEngine::new(

Calls 4

encode_opFunction · 0.85
to_stringMethod · 0.80
hlcFunction · 0.50
expectMethod · 0.45

Tested by

no test coverage detected