Use SparkListener instead of the demo thread to stop the hive server.