mirror of https://github.com/apache/druid.git
review comment - move index closure to finally
This commit is contained in:
parent
32b9290723
commit
9598a524a8
|
@ -283,7 +283,7 @@ public class IndexGeneratorJob implements Jobby
|
|||
final AggregatorFactory[] aggs = config.getSchema().getDataSchema().getAggregators();
|
||||
|
||||
IncrementalIndex index = makeIncrementalIndex(bucket, aggs);
|
||||
|
||||
try {
|
||||
File baseFlushFile = File.createTempFile("base", "flush");
|
||||
baseFlushFile.delete();
|
||||
baseFlushFile.mkdirs();
|
||||
|
@ -327,6 +327,7 @@ public class IndexGeneratorJob implements Jobby
|
|||
}
|
||||
}
|
||||
);
|
||||
// close this index and make a new one
|
||||
index.close();
|
||||
index = makeIncrementalIndex(bucket, aggs);
|
||||
|
||||
|
@ -386,13 +387,16 @@ public class IndexGeneratorJob implements Jobby
|
|||
}
|
||||
);
|
||||
}
|
||||
index.close();
|
||||
serializeOutIndex(context, bucket, mergedBase, Lists.newArrayList(allDimensionNames));
|
||||
|
||||
for (File file : toMerge) {
|
||||
FileUtils.deleteDirectory(file);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
index.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void serializeOutIndex(Context context, Bucket bucket, File mergedBase, List<String> dimensionNames)
|
||||
throws IOException
|
||||
|
|
Loading…
Reference in New Issue