DoFn.Setup和DoFn.StartBundle有什么区别? [英] What is the difference between DoFn.Setup and DoFn.StartBundle?

查看:128
本文介绍了DoFn.Setup和DoFn.StartBundle有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DoFn.Setup 该方法的注释,用于准备用于处理元素束的实例.

DoFn.Setup Annotation for the method to use to prepare an instance for processing bundles of elements.

使用单词"bundle",参数为零.

Uses the word "bundle", takes zero arguments.

DoFn.StartBundle 该方法的注释,用于准备用于处理一批元素的实例.

DoFn.StartBundle Annotation for the method to use to prepare an instance for processing a batch of elements.

使用单词"batch",接受零个或一个自变量(

Uses the word "batch", takes zero or one arguments (StartBundleContext, a way to access PipelineOptions).

我需要在DoFn实例中初始化一个库,然后将该库用于批处理"或捆绑销售"中的每个元素.我通常不会用这两个词来分开头发,但是在管道中,可能会有一些区别吗?

I need to initialize a library within the DoFn instance, then use that library for every element in the "batch" or "bundle". I wouldn't normally split hairs with these two words, but in a pipeline, there might be some difference?

推荐答案

DoFn的生命周期如下:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆