[
https://issues.apache.org/jira/browse/HDFS-5331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792317#comment-13792317
]
Vinay commented on HDFS-5331:
-----------------------------
{quote}1) SnapshotDiff class should have set conf otherwise conf will be null
right?
3) will this be good of considering generic opts for this command?{quote}
both these things will be handled by {{ToolRunner.run()}} itself. So no problem
here. Please see the {{ToolRunner.run()}} code snippet here
{code:java} public static int run(Configuration conf, Tool tool, String[]
args)
throws Exception{
if(conf == null) {
conf = new Configuration();
}
GenericOptionsParser parser = new GenericOptionsParser(conf, args);
//set the configuration back, so that Tool can configure itself
tool.setConf(conf);
//get the args w/o generic hadoop args
String[] toolArgs = parser.getRemainingArgs();
return tool.run(toolArgs);
}
{code}
bq. 2) While you are setting conf please use HdfsConfiguration.
Since {{FileSystem.get()}} is used, while instantiating the
{{DistributedFileSystem}} itself {{HdfsConfiguration}} will be loaded
automatically. So this also no problem.
> make SnapshotDiff.java to a o.a.h.util.Tool interface implementation
> --------------------------------------------------------------------
>
> Key: HDFS-5331
> URL: https://issues.apache.org/jira/browse/HDFS-5331
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: snapshots
> Affects Versions: 3.0.0, 2.1.1-beta
> Reporter: Vinay
> Assignee: Vinay
> Attachments: HDFS-5331.patch
>
>
> SnapshotDiff.java is a plain class with main() method now.
> Convert it to o.a.h.util.Tool interface implementation for better look and
> usage in tests in future,
--
This message was sent by Atlassian JIRA
(v6.1#6144)