
上QQ阅读APP看书,第一时间看更新
Controlling continuous applications
Once a continuous application (even a simple one, not taking historic data into account) is started and running, it has to be controlled somehow as the call to the start method immediately starts processing, but also returns without blocking. In case you want your program to block at this stage until the application has finished, one can use the awaitTermination method as follows:
query.awaitTermination()
This is particularly important when precompiling code and using the spark-submit command. When using spark-shell, the application is not terminated anyway.