Go SDF - Add optional params and return values to SDF methods.
Currently, the following Go SDF methods don't accept any kind of optional parameters or return values:
- CreateInitialRestriction(element) restriction
- SplitRestriction(elem, restriction) []restriction
- RestrictionSize(elem, restriction) float64
- CreateTracker(restriction) restrictionTracker
There is room for adding optional parameters and return values that are currently already supported for the ProcessElement method, as described here. The important ones to start with being Context as a parameter and errors as return values.
Implementing this will involve the following steps:
- Adjusting the validation in graph/fn.go to allow the optional parameters and return values.
- Adjust the SDF invokers in sdf_invokers.go to support the new params/returns.
- Adjust the execution code in exec/sdf.go to properly pass in the new params and appropriately handle the new return values (such as failing on errors).
Imported from Jira BEAM-11109. Original Jira may contain additional context. Reported by: danoliveira.
.take-issue
@damccorm the support for optional context parameters and error return values has been implemented. Would you like this issue to remain open if there are more optional parameters or return values that should be added?
I don't think there's any other parameters that make sense here, so I think its safe to close. @lostluck if you disagree feel free to reopen.