You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@giraph.apache.org by "Nitay Joffe (JIRA)" <ji...@apache.org> on 2013/03/27 19:37:18 UTC

[jira] [Updated] (GIRAPH-587) Refactor configuration options

     [ https://issues.apache.org/jira/browse/GIRAPH-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nitay Joffe updated GIRAPH-587:
-------------------------------

    Description: 
Introduce smart helper clases to hold configuration options (IntConfOption, StrConfOption, ClassConfOption, etc).
This has many nice effects:
- Default value stored with the option key itself.
- Much simpler, less casting, clearer code. In other words, diff has more red than green :).
- Don't have to have two constants for every option (one for name, one for default value)
- Can do things with the options now that they're actual objects. For example with little code I added an AllOptions class that prints out all of the giraph options. See 

Some other things we could do:
- Add description into the object. Auto generate docs.
- Ensure that options begin with "giraph."

And so on.

Note there's no logic change here.



  was:I think with some clever use of Enums we can cleanup our configuration options a lot. Specifically I'm thinking we should add an enum for each type of option, for example StringConfOption. This enum would contain the key name, default value, and methods to get / set it when passed a Configuration. We can have a BooleanConfOption, IntConfOption, ClassConfOption, etc. 

    
> Refactor configuration options
> ------------------------------
>
>                 Key: GIRAPH-587
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-587
>             Project: Giraph
>          Issue Type: Bug
>            Reporter: Nitay Joffe
>            Assignee: Nitay Joffe
>
> Introduce smart helper clases to hold configuration options (IntConfOption, StrConfOption, ClassConfOption, etc).
> This has many nice effects:
> - Default value stored with the option key itself.
> - Much simpler, less casting, clearer code. In other words, diff has more red than green :).
> - Don't have to have two constants for every option (one for name, one for default value)
> - Can do things with the options now that they're actual objects. For example with little code I added an AllOptions class that prints out all of the giraph options. See 
> Some other things we could do:
> - Add description into the object. Auto generate docs.
> - Ensure that options begin with "giraph."
> And so on.
> Note there's no logic change here.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira