// delete random directory protected void cleanup(Context context) throws IOException, InterruptedException { Iterator<DataPair> it = tree.iterator(); while (it.hasNext()) { DataPair dp = it.next(); context.write(new DoubleWritable(dp.getLigandDouble()), dp); } fo.deleteDir(new File("/home/hadoop/vinaJob/" + tmpPath)); }