fix potential fd leakage for SegmentProcessorFramework
@@ -142,6 +142,7 @@ public class SegmentProcessorFramework {
for (Map.Entry<String, GenericRowFileManager> entry : partitionToFileManagerMap.entrySet()) {
String partitionId = entry.getKey();
GenericRowFileManager fileManager = entry.getValue();
+ try {
GenericRowFileReader fileReader = fileManager.getFileReader();
int numRows = fileReader.getNumRows();
int numSortFields = fileReader.getNumSortFields();
@@ -163,8 +164,10 @@ public class SegmentProcessorFramework {
driver.build();
outputSegmentDirs.add(driver.getOutputDirectory());
}
+ } finally {
fileManager.cleanUp();
}
+ }
FileUtils.deleteDirectory(_mapperOutputDir);
FileUtils.deleteDirectory(_reducerOutputDir);
