When implementing the Spark streaming demo, the code:
1 Public Static voidMain (string[] args) {2 3 4sparkconf conf =NewSparkconf (). Setappname ("spark_streaming"). Setmaster ("local");5Javasparkcontext sc =Newjavasparkcontext (conf); 6Javastreamingcontext JSSC =NewJavastreamingcontext (SC,NewDuration (2)); 7Javasqlcontext Sqlctx =NewJavasqlcontext (SC); 8 9 TenString[] Filters =NewString[] {"SOC"}; One AJavareceiverinputdstream<status> Receiverstream =Twitterutils.createstream (jssc,filters); - - the - Jssc.start (); - jssc.awaittermination (); - +}
Running the above code will cause an exception:No output streams registered, so nothing to execute
The reason is that when an output operation occurs, the flow calculation operation is triggered, and when there is no output operation or calculation on the Dstream, some operations are usually required, such as in any way:
1 print () 2 Foreachrdd (func) 3 saveasobjectfiles (prefix, [suffix]) 4 saveastextfiles (prefix, [suffix]) 5 saveashadoopfiles (prefix, [suffix])
Refer to: Http://spark.apache.org/docs/latest/streaming-programming-guide.html#output-operations
Spark streaming exception No output streams registered, so nothing to execute