Yes, anything that processes bundles of elements could implement that interface, while a DoFn actually has many more capabilities (side inputs, state, setup, teardown).
If you want to discuss less generally, another way to explain this in terms of DoFn is that @Setup should happen before the DoFn is wrapped into a DoFnRunner and @Teardown should happen after the DoFnRunner will not be used anymore. Kenn On Tue, Jan 17, 2017 at 8:31 PM, Manu Zhang <[email protected]> wrote: > Hi, > > As commented here > <https://github.com/apache/beam/pull/1232#issuecomment-264243776> by Kenn( > [email protected]), the name DoFnRunner is misleading and could have nothing > to do with DoFn. > It's used for bundle processing(startBundle, processElement, stopBundle) so > there are no setup and teardown methods (which are intended for DoFn, > please check DoFnInvoker). > > Manu > > > On Thu, Jan 12, 2017 at 4:32 PM 周亮(周亮) <[email protected]> wrote: > > > hi. > > I can not find setup in SimpleDoFnRunner, why? startBundle instead of > > setup? >
