[
https://issues.apache.org/jira/browse/HADOOP-11450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14287128#comment-14287128
]
Tsuyoshi OZAWA commented on HADOOP-11450:
-----------------------------------------
[~varun_saxena] Thanks for the patch. How about using try-with-resources
statement for SequenceFile.Reader? The code paths get more readable.
{code}
try (SequenceFile.Reader in = new SequenceFile.Reader(jobconf,
Reader.file(sorted));) {
...
} catch (IOException ioe) {
LOG.warn(StringUtils.stringifyException(ioe));
}
{code}
Maybe we can also remove checkAndClose method after the refactoring.
> Cleanup DistCpV1 not to use deprecated methods and fix javadocs
> ---------------------------------------------------------------
>
> Key: HADOOP-11450
> URL: https://issues.apache.org/jira/browse/HADOOP-11450
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Tsuyoshi OZAWA
> Assignee: Varun Saxena
> Attachments: HADOOP-11450.001.patch
>
>
> Currently, DistCpV1 is using deprecated methods and having wrong javadocs. We
> should fix them.
> 1. DistCpV1.copy doesn't have dstpath, but javadoc has it.
> {code}
> /**
> * Copy a file to a destination.
> * @param srcstat src path and metadata
> * @param dstpath dst path
> {code}
> 2. Removing deprecated methods.
> {code}
> SequenceFile.Writer dir_writer = SequenceFile.createWriter(jobfs,
> jobConf, dstdirlist, Text.class, FilePair.class,
> SequenceFile.CompressionType.NONE);
> {code}
> {code}
> basedir = args.basedir.makeQualified(basefs);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)