[
https://issues.apache.org/jira/browse/HDFS-7651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15213106#comment-15213106
]
Akira AJISAKA commented on HDFS-7651:
-------------------------------------
Thanks Brahma for the refactoring, and thanks Vinayakumar for pinging me. I'm
thinking we can refactor NNBench.java more.
{code}
writer = SequenceFile.createWriter(tempFS, getConf(), filePath,
Text.class,
LongWritable.class, CompressionType.NONE);
{code}
1. {{createWriter(FileSystem, Configuration, Path, Class, Class,
CompressionType)}} is deperecated. Would you use {{createWriter(Configuration,
Writer.Option...)}} instead?
{code}
PrintStream res = new PrintStream(
new FileOutputStream(new File(DEFAULT_RES_FILE_NAME), true));
try {
{code}
2. Would you use try-with-resources statement?
{code}
for (int i = 0; i < resultLines.length; i++) {
LOG.info(resultLines[i]);
res.println(resultLines[i]);
}
{code}
3. foreach statement can be used.
{code}
throw new HadoopIllegalArgumentException(
"\"Error: Unknown operation: \" + operation");
{code}
4. I'm thinking we don't need to escape {{"}}.
5. Would you add a regression test for NNBench.java? I don't want to cause a
bug such as MAPREDUCE-6656. I'd like to test the following 2 cases.
* create_write -> open_read -> delete
* create_write -> rename
> [ NN Bench ] Refactor nnbench as a Tool implementation.
> -------------------------------------------------------
>
> Key: HDFS-7651
> URL: https://issues.apache.org/jira/browse/HDFS-7651
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 2.6.0
> Reporter: Brahma Reddy Battula
> Assignee: Brahma Reddy Battula
> Attachments: HDFS-7651-001.patch, HDFS-7651-002.patch
>
>
> {code}
> public class NNBench {
> private static final Log LOG = LogFactory.getLog(
> "org.apache.hadoop.hdfs.NNBench");
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)