From 20e7e53ede1d9ef746078c1bacc7e97e18c205b2 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Mon, 9 Nov 2020 22:40:28 -0800 Subject: [PATCH] Use FileUtils.createTempDir in IndexGeneratorJob. (#10568) Simplifies code by using a method designed for this purpose. --- .../java/org/apache/druid/indexer/IndexGeneratorJob.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/indexing-hadoop/src/main/java/org/apache/druid/indexer/IndexGeneratorJob.java b/indexing-hadoop/src/main/java/org/apache/druid/indexer/IndexGeneratorJob.java index abc0b3bc96f..89259064869 100644 --- a/indexing-hadoop/src/main/java/org/apache/druid/indexer/IndexGeneratorJob.java +++ b/indexing-hadoop/src/main/java/org/apache/druid/indexer/IndexGeneratorJob.java @@ -645,10 +645,7 @@ public class IndexGeneratorJob implements Jobby null ); try { - File baseFlushFile = File.createTempFile("base", "flush"); - baseFlushFile.delete(); - baseFlushFile.mkdirs(); - + File baseFlushFile = FileUtils.createTempDir("base-flush"); Set toMerge = new TreeSet<>(); int indexCount = 0; int lineCount = 0;