You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2015/07/17 19:01:04 UTC

[jira] [Commented] (HADOOP-12249) pull argument parsing into a function

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

Allen Wittenauer commented on HADOOP-12249:
-------------------------------------------

The current way all of the *-config.sh code is written it assumes that all argv work must be done at the global layer.  During the rewrite, this was done in order to facilitate backward compatibility with non-Hadoop components.

However.

This is actually worked around very easily: the only *real* requirement is that items get pulled off the stack via shift.  This can be done by setting a global var that tells the caller of the argument parsing how many to shift off the stack after they've called our argument parser.

In turn, this means that bin/* and sbin/* can also then be converted to use primarily functions, further enabling better unit testing.

> pull argument parsing into a function
> -------------------------------------
>
>                 Key: HADOOP-12249
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12249
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.0.0
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>              Labels: scripts, shell
>
> In order to enable significantly better unit testing as well as enhanced functionality, large portions of *-config.sh should be pulled into functions.  See first comment for more.



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