【问题标题】:Issue with reading millions of files from cloud storage using dataflow in Google cloud使用谷歌云中的数据流从云存储中读取数百万个文件的问题
【发布时间】:2022-08-16 06:55:17
【问题描述】:

场景:我正在尝试读取文件并将数据发送到 pub/sub

  1. 数百万个文件存储在云存储文件夹 (GCP) 中

  2. 我已经使用来自 pub/sub 主题的模板 \"Text files on cloud storage to Pub/Sub\" 创建了一个数据流管道

  3. 但是上面的模板无法读取数百万个文件并失败并出现以下错误

    java.lang.IllegalArgumentException: Total size of the BoundedSource objects generated by split() operation is larger than the allowable limit. When splitting gs://filelocation/data/*.json into bundles of 28401539859 bytes it generated 2397802 BoundedSource objects with total serialized size of 199603686 bytes which is larger than the limit 20971520.

    系统配置:Apache 梁:2.38 Java SDK 机器:高性能 n1-highmem-16

    关于如何解决这个问题的任何想法?提前致谢

    标签: google-cloud-platform google-cloud-storage google-cloud-dataflow apache-beam google-cloud-pubsub


    【解决方案1】:

    根据本文档 (1),您可以通过修改自定义 BoundedSource 子类来解决此问题,以便生成的 BoundedSource 对象变得小于 20 MB 限制。

    (1)https://cloud.google.com/dataflow/docs/guides/common-errors#boundedsource-objects-splitintobundles

    【讨论】:

      【解决方案2】:

      您也可以使用TextIO.readAll() 来避免这些限制。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-30
        • 1970-01-01
        • 1970-01-01
        • 2019-10-15
        • 1970-01-01
        • 2021-07-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多