chukwa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ari Rabkin (JIRA)" <>
Subject [jira] Commented: (CHUKWA-381) standardized code style for options
Date Thu, 20 Aug 2009 03:34:14 GMT


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:
>             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.

View raw message