You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chukwa.apache.org by "Ari Rabkin (JIRA)" <ji...@apache.org> on 2009/08/20 05:34:14 UTC

[jira] Commented: (CHUKWA-381) standardized code style for options

    [ https://issues.apache.org/jira/browse/CHUKWA-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12745291#action_12745291 ] 

Ari Rabkin commented on CHUKWA-381:
-----------------------------------

My preferred style is as follows:
For option Foo:

public static final String FOO_OPT = "component.subcomponent.option"
int FOO = defaultFoo;

in conf method:
FOO = conf.getInt(FOO_OPT, FOO).

Code that sets or reads the option should use the _OPT, rather than the actual string. This makes it possible to rename options.  This style also leaves the default value clearly visible in one place.

Thoughts, comments?

> standardized code style for options
> -----------------------------------
>
>                 Key: CHUKWA-381
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-381
>             Project: Hadoop Chukwa
>          Issue Type: Improvement
>          Components: build and test code, data collection, Data Processors, documentation
>            Reporter: Ari Rabkin
>
> Right now, we have about six different code styles in use for conf options. This is a bad thing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.