2017-09-21 141 views
0

我試着去我的天藍色Blob存儲註冊到我的火花流,但得到這個代碼&錯誤: -火花流訪問蔚藍BLOB

代碼: -

SparkConf sparkConf = new SparkConf().setAppName("JavaNetworkWordCount"); 
     JavaStreamingContext ssc = new JavaStreamingContext(sparkConf, Durations.seconds(1)); 
     ssc.textFileStream("wasb[s]://[email protected]/"); 
     ssc.start(); 
     ssc.awaitTermination(); 

不知道應該是什麼樣的路徑WASB鏈接

https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-use-blob-storage#address-files-in-azure-storage

的鏈接說,我應該給一個路徑,但我的容器沒有任何路徑。圖像直接存儲在容器中。

錯誤: -

java.lang.IllegalArgumentException: requirement failed: No output operations registered, so nothing to execute 
    at scala.Predef$.require(Predef.scala:224) 
    at org.apache.spark.streaming.DStreamGraph.validate(DStreamGraph.scala:163) 
    at org.apache.spark.streaming.StreamingContext.validate(StreamingContext.scala:513) 
    at org.apache.spark.streaming.StreamingContext.liftedTree1$1(StreamingContext.scala:573) 
    at org.apache.spark.streaming.StreamingContext.start(StreamingContext.scala:572) 
    at org.apache.spark.streaming.api.java.JavaStreamingContext.start(JavaStreamingContext.scala:554) 
    at org.bnr.process_panos.JavaNetworkWordCount.main(JavaNetworkWordCount.java:43) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:736) 
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:185) 
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:210) 
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:124) 
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) 

回答

0

您可以使用相對路徑或絕對路徑。例如,附帶HDInsight集羣Hadoop的MapReduce的examples.jar文件可以通過使用下列中的一個被稱爲:

例1:wasb://[email protected]。淨/示例/瓶/ Hadoop的MapReduce的examples.jar

例2: wasb:///example/jars/hadoop-mapreduce-examples.jar

示例3:/示例/瓶/ Hadoop的MapReduce的examples.jar

在DStream上沒有輸出運算符時,會發生以下錯誤消息,不會調用任何計算。你需要調用以下任何一種方法。

打印()

foreachRDD(FUNC)

saveAsObjectFiles(前綴,[後綴])

saveAsTextFiles(前綴,[後綴])

saveAsHadoopFiles(pref IX,[後綴])

詳情,請參閱「http://spark.apache.org/docs/latest/streaming-programming-guide.html#output-operations」。

+0

我可以hdinsight集羣內只能使用或我可以使用洞察集羣的外側的保存鏈接? – user1050619