MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / recomputeNodeSelfOnly

Function recomputeNodeSelfOnly

pj_datastore/src/derived_engine.cpp:1234–1275  ·  view source on GitHub ↗

Clear ONE node's output, reset its op + watermarks, and fully replay its input. The per-node primitive behind recomputeBatch's self+downstream cascade — does NOT touch downstream nodes. clearChunks (not retireTopic) keeps every TopicStorage alive so cached reader pointers stay valid.

Source from the content-addressed store, hash-verified

1232// downstream nodes. clearChunks (not retireTopic) keeps every TopicStorage alive so cached
1233// reader pointers stay valid.
1234static PJ::Status recomputeNodeSelfOnly(DerivedEngineImpl& impl, DataEngine& engine, DerivedNode& node) {
1235 // 1. Clear all output chunks unconditionally.
1236 for (PJ::TopicId out_tid : node.output_topic_ids) {
1237 TopicStorage* storage = engine.getTopicStorage(out_tid);
1238 if (storage) {
1239 storage->clearChunks();
1240 }
1241 }
1242
1243 // 2. Reset transform state
1244 if (!node.is_mimo) {
1245 if (node.siso_op) {
1246 node.siso_op->reset();
1247 }
1248 } else {
1249 if (node.mimo_op) {
1250 node.mimo_op->reset();
1251 }
1252 }
1253
1254 // 3. Reset processed watermarks (chunk ids and timestamps)
1255 node.last_processed_chunk_id = 0;
1256 node.siso_last_ts = std::numeric_limits<PJ::Timestamp>::min();
1257 if (node.is_mimo) {
1258 node.mimo_last_ts = std::numeric_limits<PJ::Timestamp>::min();
1259 node.mimo_last_chunk_id = 0;
1260 }
1261
1262 // 4. Full replay
1263 PJ::Status s = PJ::okStatus();
1264 if (!node.is_mimo) {
1265 s = runSisoIncremental(impl, engine, node);
1266 } else {
1267 s = runMimoIncremental(impl, engine, node);
1268 }
1269
1270 if (!s.has_value()) {
1271 return s;
1272 }
1273 node.dirty = false;
1274 return PJ::okStatus();
1275}
1276
1277PJ::Status DerivedEngine::recomputeBatch(PJ::NodeId node_id) {
1278 auto lock = engine_.lockEngine(); // exclusive for the whole clear+replay cascade

Callers 1

recomputeBatchLockedMethod · 0.85

Calls 5

runSisoIncrementalFunction · 0.85
runMimoIncrementalFunction · 0.85
getTopicStorageMethod · 0.80
clearChunksMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected