lostluck commented on code in PR #36219:
URL: https://github.com/apache/beam/pull/36219#discussion_r2370384198
##########
sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go:
##########
@@ -1493,9 +1520,9 @@ func (ss *stageState) savePanes(bundID string,
panesInBundle []bundlePane) {
// buildTriggeredBundle must be called with the stage.mu lock held.
// When in discarding mode, returns 0.
// When in accumulating mode, returns the number of fired elements to maintain
a correct pending count.
-func (ss *stageState) buildTriggeredBundle(em *ElementManager, key []byte, win
typex.Window) int {
+func (ss *stageState) buildTriggeredBundle(em *ElementManager, key string, win
typex.Window) int {
var toProcess []element
- dnt := ss.pendingByKeys[string(key)]
Review Comment:
I'll note that Go does some magic when passing a string cast []byte as a map
key inline, which avoids allocating. That's why this method took in a []byte
for the key, instead of eagerly converting it.
##########
sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go:
##########
@@ -1537,15 +1564,15 @@ func (ss *stageState) buildTriggeredBundle(em
*ElementManager, key []byte, win t
{
win: win,
key: string(key),
- pane: ss.state[LinkID{}][win][string(key)].Pane,
+ pane: ss.state[LinkID{}][win][key].Pane,
},
}
ss.makeInProgressBundle(
func() string { return rb.BundleID },
toProcess,
ss.input,
- singleSet(string(key)),
Review Comment:
But this over here probably made the string(key) (when key is []byte) moot
anyway.
--
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]