public static void cleanUp(String jobID, Configuration config) {
StatsAggregator statsAggregator;
String statsImplementationClass = HiveConf.getVar(config, HiveConf.ConfVars.HIVESTATSDBCLASS);
StatsFactory.setImplementation(statsImplementationClass, config);
statsAggregator = StatsFactory.getStatsAggregator();
if (statsAggregator.connect(config)) {
statsAggregator.cleanUp(jobID + Path.SEPARATOR); // Adding the path separator to avoid an Id
// being a prefix of another ID
statsAggregator.closeConnection();
}
}