lostluck commented on code in PR #31057:
URL: https://github.com/apache/beam/pull/31057#discussion_r1576877619


##########
sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go:
##########
@@ -532,12 +533,26 @@ func (em *ElementManager) StateForBundle(rb RunBundle) 
TentativeData {
        return ret
 }
 
+// Residual represents the unprocessed portion of a single element to be 
rescheduled for processing later.
+type Residual struct {
+       Element []byte
+       Delay   time.Duration // The relative time delay.
+       Bounded bool          // Whether this element is finite or not.
+}
+
+// Residuals is used to specify process continuations within a bundle.
+type Residuals struct {

Review Comment:
   Sure. I haven't tried using the go 1.19 godoc improvements yet. But be aware 
these are internal packages and it's very unlikely that someone will ever look 
at the godoc for them without simply looking at the code directly.
   
   I'll do this in a subsequent PR since this change is pre-work, and far from 
its final shape.
   
   -----
   
   Short answer: No. It's not instantiated in any meaningful way if the user 
code doesn't return a ProcessContinuation. Delay or similar, since SDK doesn't 
return residuals if the user doesn't explicitly use a ProcessContinuation.
   
   Timers are an orthogonal more primitive concept. One could implement 
processing continuations in terms of ProcessingTime timers and State. That 
might be how this ultimately ends up working. I don't know yet.
   
   Residuals is a type, so to talk about instantiation you need to point to a 
specific instance or not. It's also a small type with 4 fields. If the map and 
slices remain instantiated themselves, then they are nil. Go struct 
instantiations are very very cheap.



-- 
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]

Reply via email to