public boolean closeConnection() {
Path statsDir = new Path(conf.get(StatsSetupConst.STATS_TMP_LOC));
try {
Path statsFile = new Path(statsDir,StatsSetupConst.STATS_FILE_PREFIX +conf.getInt("mapred.task.partition",0));
LOG.debug("About to create stats file for this task : " + statsFile);
Output output = new Output(statsFile.getFileSystem(conf).create(statsFile,true));
LOG.info("Created file : " + statsFile);
LOG.info("Writing stats in it : " + statsMap);
Utilities.runtimeSerializationKryo.get().writeObject(output, statsMap);
output.close();
return true;
} catch (IOException e) {
LOG.error(e);
return false;
}