java - 作业图太大,无法提交到 Google Cloud Dataflow
问题描述
我正在尝试在 Dataflow 上运行作业,每当我尝试提交它以使用 DataflowRunner 运行时,我都会从服务中收到以下错误:
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Request payload size exceeds the limit: x bytes.",
"reason" : "badRequest"
} ],
"message" : "Request payload size exceeds the limit: x bytes.",
"status" : "INVALID_ARGUMENT"
}
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"reason" : "badRequest",
"debugInfo" : "detail: \"(3754670dbaa1cc6b): CreateJob fails due to Spanner error: New value exceeds the maximum size limit for this column in this database: Jobs.CloudWorkflowJob, size: 17278017, limit: 10485760.\"\n"
} ],
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"status" : "INVALID_ARGUMENT"
}
如何将我的工作更改为更小,或增加工作大小限制?
解决方案
此问题有一个解决方法,可让您将作业图的大小增加到最多 100MB。您可以指定此实验:--experiments=upload_graph
。
实验激活了一个新的提交路径,该路径将作业文件上传到 GCS,并通过不包含作业图的 HTTP 请求创建作业 - 只是对其的引用。
这样做的缺点是 UI 可能无法正确显示作业,因为它依赖于 API 请求来共享作业。
额外说明:减小作业图的大小仍然是一种很好的做法。
一个重要提示是,有时可以创建一些匿名 DoFns / lambda 函数,这些函数在其闭包中具有非常大的上下文,因此我建议查看代码中的任何闭包,并确保它们不包含非常大的上下文他们自己。
也许避免匿名 lambdas/DoFns 会有所帮助,因为上下文将是类的一部分,而不是序列化对象。
推荐阅读
- node.js - 如何解决 Express Validator 中间件错误?
- android - 在 IOS 上找不到模块“flutter_keyboard_visibility”
- php - foreach 正在丢失对象的值
- angular - 有多少种方法可以提高角度性能?
- python - 使用 ImageField 对 Django ModelForm 进行单元测试,测试显示无效的表单
- c - 在 C 宏和转换方面需要帮助
- c# - 在 C# 中将 IByteBuffer 转换为字符串
- selenium - 如何在 Junit 中同时使用 Jmeter 和 Selenium Webdriver 运行 1000 个用户而不导致 PC 挂起?
- date - 如何使用没有数字偏移的默认区域格式化日期
- python - 将pymysql结果转换为对象