[
https://issues.apache.org/jira/browse/HADOOP-11569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14338059#comment-14338059
]
Tsuyoshi Ozawa commented on HADOOP-11569:
-----------------------------------------
[~vinayrpet] thank you for taking this issue.
{code}
+ private void close() throws IOException {
+ IOUtils.closeStream(outWriter);
+ outWriter = null;
+ for (int i = 0; i < inReaders.length; i++) {
+ IOUtils.closeStream(inReaders[i]);
+ inReaders[i] = null;
+ }
{code}
Should we raise Exception when outWriter#close raises exception? It can mean
that flush() failed in writer#close() (e.g. DFSClient#flush() failed). For the
case, I think we should close inReaders before closing Writer to prevent fd
leaks. What do you think?
Minor nits: about testMerge, we can use try-with-resources statement for writer
and reader.
> Provide Merge API for MapFile to merge multiple similar MapFiles to one
> MapFile
> -------------------------------------------------------------------------------
>
> Key: HADOOP-11569
> URL: https://issues.apache.org/jira/browse/HADOOP-11569
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Vinayakumar B
> Assignee: Vinayakumar B
> Attachments: HADOOP-11569-001.patch, HADOOP-11569-002.patch,
> HADOOP-11569-003.patch, HADOOP-11569-004.patch
>
>
> If there are multiple similar MapFiles of the same keyClass and value
> classes, then these can be merged together to One MapFile to allow search
> easier.
> Provide an API similar to {{SequenceFile#merge()}}.
> Merging will be easy with the fact that MapFiles are already sorted.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)