twitter/ambrose — pull request #152 by amatsukawa (2014-06-19 23:18:51+00:00)
Title: Add shutdown method to StatsWriteService

Currently, a cascading driver program that is integrated with an ambrose listener never actually terminates. The only way to shutdown an `HRaveStatsWriteService` is via a shutdown hook, eg
```java
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
shutdown();
}
});
```
This works in pig, which explicitly calls `System.exit(run(...))` where `run` drives the entire pig program. Scalding does not have such an explicit `System.exit`, so the executor pool hangs forever waiting for instructions.

This PR adds a `StatsWriteService#shutdownWriteService` method to gracefully shutdown the write service. Add a call to this method in the cascading `onComplete` method, which is called when all work for the flow is finished.