-
-
Save mslitao/574776a0ad5dac00547e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def main(args: Array[String]) { | |
| // Prepare your environment | |
| val ssc = new StreamingContext(conf, Seconds(batchDurationInSec)) | |
| // Do your processing | |
| sys.ShutdownHookThread { | |
| log.info("Gracefully stopping Spark Streaming Application") | |
| ssc.stop(true, true) | |
| log.info("Application stopped") | |
| } | |
| ssc.start | |
| ssc.awaitTermination | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment