From fde7269c86d660df1797ffff77389bdd30940bbf Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Sat, 15 Feb 2014 04:30:14 +0530 Subject: [PATCH] check published segments before the intermediate files are cleaned up --- .../java/io/druid/indexer/DeterminePartitionsJob.java | 2 +- .../java/io/druid/indexer/HadoopDruidIndexerJob.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java index 3ebefb7bddc..e2284988dd9 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java @@ -724,7 +724,7 @@ public class DeterminePartitionsJob implements Jobby } final OutputStream out = Utils.makePathAndOutputStream( - context, config.makeSegmentPartitionInfoPath(config.getGranularitySpec().getGranularity().bucket(bucket)), config.isOverwriteFiles() + context, config.makeSegmentPartitionInfoPath(config.getGranularitySpec().bucketInterval(bucket).get()), config.isOverwriteFiles() ); final DimPartitions chosenPartitions = maxCardinality > HIGH_CARDINALITY_THRESHOLD diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerJob.java b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerJob.java index 598b3a8db1d..64bc1267146 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerJob.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerJob.java @@ -66,9 +66,18 @@ public class HadoopDruidIndexerJob implements Jobby log.info("No updaterJobSpec set, not uploading to database"); } + jobs.add(new Jobby() + { + @Override + public boolean run() + { + publishedSegments = IndexGeneratorJob.getPublishedSegments(config); + return true; + } + }); + JobHelper.runJobs(jobs, config); - publishedSegments = IndexGeneratorJob.getPublishedSegments(config); return true; }