0

我有一个梁管道,它在应用一些转换后从 PubSub 读取并写入 BigQuery。管道始终因 NPE 而失败。我正在使用梁 SDK 版本 0.6.0。关于我可能做错了什么的任何想法?我正在尝试使用 DirectRunner 运行管道。

java.lang.NullPointerException
at org.apache.beam.sdk.io.PubsubUnboundedSource$PubsubReader.ackBatch(PubsubUnboundedSource.java:640)
at org.apache.beam.sdk.io.PubsubUnboundedSource$PubsubCheckpoint.finalizeCheckpoint(PubsubUnboundedSource.java:313)
at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.getReader(UnboundedReadEvaluatorFactory.java:174)
at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement(UnboundedReadEvaluatorFactory.java:127)
at org.apache.beam.runners.direct.TransformExecutor.processElements(TransformExecutor.java:139)
at org.apache.beam.runners.direct.TransformExecutor.run(TransformExecutor.java:107)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
4

1 回答 1

1

由于 DirectRunner 中的错误 ( BEAM-1656 ) 和 PubsubCheckpoint 中的前提条件而存在此问题。DirectRunner 中的错误已在 pull request 2237中修复,该请求已合并到 Github master 分支中,但在 0.6.0 版本之后。

在使用 DirectRunner 时,更新到 0.7.0 nightly build 或从 github HEAD 构建将解决这个问题。

要更新到当前的夜间构建,您必须将以下存储库添加到项目的pom.xml. beam-runners-direct-java包含此修复程序的模块的最早版本是0.7.0-20170316.070901-9,但并非所有模块都使用此特定版本构建,因此您可能必须指定单独兼容的版本或使用0.7.0-SNAPSHOT

    <repositories>
      <repository>
        <id>apache.snapshots</id>
        <name>Apache Development Snapshot Repository</name>

 <url>https://repository.apache.org/content/repositories/snapshots/</url>
        <releases>
          <enabled>false</enabled>
        </releases>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
      </repository>

    </repositories>
于 2017-03-24T17:13:10.123 回答