Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 使用PubSub NullPointerException触发流式处理,同时在java中从pub-sub进行流式处理_Google Cloud Platform_Spark Streaming_Google Cloud Pubsub - Fatal编程技术网

Google cloud platform 使用PubSub NullPointerException触发流式处理,同时在java中从pub-sub进行流式处理

Google cloud platform 使用PubSub NullPointerException触发流式处理,同时在java中从pub-sub进行流式处理,google-cloud-platform,spark-streaming,google-cloud-pubsub,Google Cloud Platform,Spark Streaming,Google Cloud Pubsub,我的数据在PubSub中,我想流式传输数据。我使用dataproc在java中运行spark作业。但该作业失败,出现以下错误 19/06/18 06:32:30 WARN org.apache.spark.streaming.scheduler.ReceiverTracker:接收方为流0报告的错误:未能提取消息-java.lang.NullPointerException 在scala.collection.convert.Wrappers$jlistwapper.iterator(Wrapp

我的数据在PubSub中,我想流式传输数据。我使用dataproc在java中运行spark作业。但该作业失败,出现以下错误

19/06/18 06:32:30 WARN org.apache.spark.streaming.scheduler.ReceiverTracker:接收方为流0报告的错误:未能提取消息-java.lang.NullPointerException 在scala.collection.convert.Wrappers$jlistwapper.iterator(Wrappers.scala:88) 位于scala.collection.IterableLike$class.foreach(IterableLike.scala:72) 位于scala.collection.AbstractIterable.foreach(Iterable.scala:54) 在scala.collection.generic.growtable$class.$plus$plus$eq(growtable.scala:59) 位于scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:183) 位于scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45) 在scala.collection.TraversableLike$class.to处(TraversableLike.scala:590) 位于scala.collection.AbstractTraversable.to(Traversable.scala:104) 位于scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:294) 位于scala.collection.AbstractTraversable.toList(Traversable.scala:104) 在org.apache.spark.streaming.pubsub.PubsubReceiver.receive(PubsubInputDStream.scala:259) 位于org.apache.spark.streaming.pubsub.PubsubReceiver$$anon$1.run(PubsubInputDStream.scala:247)

我使用的代码段是


PubsubUtils.createStream(jssc,“projectId”、“TopicName”、“subscriptionName”、新的SparkGCPCredentials.Builder().jsonServiceAccount(“放置在dataproc中的json的绝对路径”)、StorageLevel.MEMORY_和_DISK_2()

当spark尝试在没有等待事件的情况下从pubsub订阅读取事件时,会显示此警告。它不应该中断作业,而只是意味着对于给定的一批数据没有要读取的事件。

有没有办法避免它?