beam icon indicating copy to clipboard operation
beam copied to clipboard

Go SDF - Add optional params and return values to SDF methods.

Open damccorm opened this issue 4 years ago • 3 comments

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.

damccorm avatar Jun 04 '22 18:06 damccorm

.take-issue

johannaojeling avatar Feb 11 '23 17:02 johannaojeling

@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?‌

johannaojeling avatar Mar 09 '23 17:03 johannaojeling

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.

damccorm avatar Mar 10 '23 13:03 damccorm