leventov commented on a change in pull request #6699: release mmap immediately
after merge indexes
URL: https://github.com/apache/incubator-druid/pull/6699#discussion_r239528996
##########
File path: processing/src/main/java/org/apache/druid/segment/IndexMergerV9.java
##########
@@ -798,6 +798,40 @@ public File persist(
);
}
+ @Override
+ public File mergeSegmentFiles(
+ File[] segmentFiles,
+ boolean rollup,
+ AggregatorFactory[] metricAggs,
+ File outDir,
+ IndexSpec indexSpec,
+ @Nullable SegmentWriteOutMediumFactory segmentWriteOutMediumFactory
+ ) throws IOException
+ {
+ List<QueryableIndex> indexes =
Lists.transform(Arrays.asList(segmentFiles), input -> {
+ try {
+ return indexIO.loadIndex(input);
+ }
+ catch (IOException e) {
+ throw new ISE(e, "load index %s failed!?", input.getAbsolutePath());
+ }
+ });
+
+ try {
+ return mergeQueryableIndex(indexes, rollup, metricAggs, outDir,
indexSpec, new BaseProgressIndicator(), segmentWriteOutMediumFactory);
+ }
+ finally {
+ for (QueryableIndex index : indexes) {
Review comment:
Use Closer to close many objects.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]