Description
Current version of StreamingContext.stop() directly kills all the data receivers (NetworkReceiver) without waiting for the data already received to be persisted and processed. Fixing this requires the following.
1. Each receiver, when it gets a stop signal from the driver, should stop receiving, and then wait for all the received data to have been persisted and reported to the driver.
2. The driver, after stopping all the receivers, should wait for all the received to be processed.