From 2dea60251ba32033378b172deb66a55bfaad6ec6 Mon Sep 17 00:00:00 2001 From: Kiran Patchigolla Date: Mon, 3 Mar 2014 13:33:47 -0800 Subject: [PATCH] Temp filePeon files cleanup Related to https://groups.google.com/forum/#!topic/druid-development/TFUNas5ubyc cleanup() method is added but still some files are not cleaned up. Additionally setting deleteOnExit on these temp files --- .../src/main/java/io/druid/segment/data/TmpFileIOPeon.java | 1 + 1 file changed, 1 insertion(+) diff --git a/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java b/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java index a60ed66838c..a575c4116f1 100644 --- a/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java +++ b/processing/src/main/java/io/druid/segment/data/TmpFileIOPeon.java @@ -42,6 +42,7 @@ public class TmpFileIOPeon implements IOPeon File retFile = createdFiles.get(filename); if (retFile == null) { retFile = File.createTempFile("filePeon", filename); + retFile.deleteOnExit(); createdFiles.put(filename, retFile); } return new BufferedOutputStream(new FileOutputStream(retFile));