[ 
https://issues.apache.org/jira/browse/HDFS-9519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15049855#comment-15049855
 ] 

Yongjun Zhang commented on HDFS-9519:
-------------------------------------

Thanks [~xiaochen] for the patch.

Can we move the main comment to the beginning of the block, something like:
{code}
      // SecondaryNameNode can be started to run a command (i.e. checkpoint or
      // geteditsize etc) and terminate, or to run as a daemon when no command 
is 
      // specified. The web server is only needed when 2NN runs as a daemon.
      if (opts != null && opts.getCommand() != null) {
        // 2NN is started to run a command and then terminate
        int ret = secondary.processStartupCommand(opts);
        terminate(ret);
      }
      
      // 2NN runs as a daemon, start the web server
      secondary.startInfoServer();
{code}

Thanks.


> Some coding improvement in SecondaryNameNode#main
> -------------------------------------------------
>
>                 Key: HDFS-9519
>                 URL: https://issues.apache.org/jira/browse/HDFS-9519
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>            Reporter: Yongjun Zhang
>            Assignee: Xiao Chen
>         Attachments: HDFS-9519.01.patch
>
>
> Two nits:
> # The checking whether secondary is null is not necessary in the following 
> code in SecondaryNameNode.java. 
> # The comment in this code seems to imply that "when secondary is not null, 
> SNN was stared as a daemon.", and this is not true. Suggest to improve the 
> comment to make it clear,
> Assign to Xiao since he worked on HDFS-3059. Thanks Xiao.
> {code}
>       if (secondary != null) {
>         // The web server is only needed when starting SNN as a daemon,
>         // and not needed if called from shell command. Starting the web 
> server
>         // from shell may fail when getting credentials, if the environment
>         // is not set up for it, which is most of the case.
>         secondary.startInfoServer();
>         secondary.startCheckpointThread();
>         secondary.join();
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to