[ https://issues.apache.org/jira/browse/BEAM-3736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17124134#comment-17124134 ]
Luke Cwik commented on BEAM-3736: --------------------------------- May I suggest: Step 0: Add a ValidatesRunner test that fails if setup isn't invoked. Take a look at some of the lifecycle tests: https://github.com/apache/beam/blob/9c16b898f0c90e83d74f5ac1a0d5b8853f872ebb/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java#L1500 You can then validate that in step 1 it fails because the runner is rejecting it and in step 2 it should now pass. > Add SetUp() and TearDown() for CombineFns > ----------------------------------------- > > Key: BEAM-3736 > URL: https://issues.apache.org/jira/browse/BEAM-3736 > Project: Beam > Issue Type: Improvement > Components: beam-model, sdk-py-core > Reporter: Chuan Yu Foo > Priority: P2 > > I have a CombineFn that has a large amount of state that needs to be loaded > once before it can add_input or merge_combiners (for example, the CombineFn > might load up a large lookup table used for combining). > Right now, to initialise this state, for each of the methods, I check if the > state has already been initialised, and if not, I initialise it. It would be > nice if CombineFn provided a SetUp() method that is called once to initialise > this state (and a corresponding TearDown() method to clean up this state if > necessary). -- This message was sent by Atlassian Jira (v8.3.4#803005)