aglinxinyuan commented on code in PR #9366:
URL: https://github.com/apache/texera/pull/9366#discussion_r4535786746
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessor.scala:
##########
@@ -150,8 +164,12 @@ class DataProcessor(
// Carry the incoming loop envelope through unchanged: loop operators
// are Python-only, so a JVM operator inside a loop body only ever
// forwards the envelope (the +1/-1 bookkeeping lives in the Python
- // runtime's _process_state_frame).
- outputManager.emitState(outputState.get, loopCounter, loopStartId)
+ // runtime's _process_state_frame). A state sent on unchanged is the
+ // same message and keeps its id; a changed one is a new message.
+ val outputMessageId =
+ if (outputState.get.toJson == state.toJson) messageId
Review Comment:
Done in fa08044725 — the JVM now checks `outputState.get eq state` before
comparing JSON, since a `State`'s map can't change (`==` would call `2` and
`2.0` equal; a `DataProcessorSpec` case in d0280bfb51 pins that a `2` turned
into `2.0` gets a new id), and Python skips the JSON when the operator keeps
the default `process_state`. A Python `State` is a dict a callback can edit in
place, so identity alone can't tell there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]