Apache Beam:Python SDK 中的 DoFn.Setup 等效项 [英] Apache Beam: DoFn.Setup equivalent in Python SDK

查看:28
本文介绍了Apache Beam:Python SDK 中的 DoFn.Setup 等效项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Beam Python DoFn 中进行昂贵的一次性初始化的推荐方法是什么?Java SDK 有 DoFn.Setup,但在 Beam Python 中似乎没有等效项.

What is the recommended way to do expensive one-off initialization in a Beam Python DoFn? The Java SDK has DoFn.Setup, but there doesn't appear to be an equivalent in Beam Python.

是目前最好的方法 将对象附加到 DoFn 初始值设定项中的 threading.local()?

Is the best way currently to attach objects to threading.local() in the DoFn initializer?

推荐答案

安装和拆卸现在已经添加到 Python SDK 并且是在 Beam Python DoFn 中进行昂贵的一次性初始化的推荐方法.

Setup and teardown have now been added to the Python SDK and are the recommended way to do expensive one-off initialization in a Beam Python DoFn.

这篇关于Apache Beam:Python SDK 中的 DoFn.Setup 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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