Merge pull request #483 from pwendell/gitignore

Restricting /lib to top level directory in .gitignore

This patch was proposed by Sean Mackrory.
(cherry picked from commit 7373ffb5e794d3163d3f8d1801836c891e0d6cca)

Signed-off-by: Patrick Wendell <pwendell@gmail.com>
Merge pull request #482 from tdas/streaming-example-fix

Added StreamingContext.awaitTermination to streaming examples

StreamingContext.start() currently starts a non-daemon thread which prevents termination of a Spark Streaming program even if main function has exited. Since the expected behavior of a streaming program is to run until explicitly killed, this was sort of fine when spark streaming applications are launched from the command line. However, when launched in Yarn-standalone mode, this did not work as the driver effectively got terminated when the main function exits. So SparkStreaming examples did not work on Yarn.

This addition to the examples ensures that the examples work on Yarn and also ensures that everyone learns that StreamingContext.awaitTermination() being necessary for SparkStreaming programs to wait.

The true bug-fix of making sure all threads by Spark Streaming are daemon threads is left for post-0.9.
(cherry picked from commit 0367981d47761cdccd8a44fc6fe803079979c5e3)

Signed-off-by: Patrick Wendell <pwendell@gmail.com>