[
https://issues.apache.org/jira/browse/HADOOP-6287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760628#action_12760628
]
Philip Zeyliger commented on HADOOP-6287:
-----------------------------------------
I'm +1 eric's suggestion: I think config documentation and code should be
co-located, and should generate things.
I'd like to do something like this:
{code}
@ConfigVariableDeclaration
public final static ConfigVariable<URI> fsDefaultName =
ConfigVariableBuilder.newURI()
.setDefault(null)
.setHelp("Default filesystem")
.setVisibility(Visibility.PUBLIC)
.addAccessor("fs.default.name")
.addDeprecatedAccessor("core.default.fs", "Use foo instead")
.addValidator(new ValidateSupportedFilesystem());
{code}
(See more at https://issues.apache.org/jira/browse/HADOOP-6105#action_12727143)
Yes, this imposes a type system: fsDefaultName now has to be a URI. There
could be other units/validators for time, disk, etc. You then should access
the variable by using "fsDefaultName.get(Configuration)", which means that it's
easy to find all usages of the configuration. I'd very much like Hadoop to
find configuration errors early, and for those errors to be sensible. (It
would help both with NPEs deep inside of things that aren't obviously looking
at configuration, but also at the wide array of ways we store comma-delimited
values in Configuration: we should only be writing that logic correctly once,
and, you know, we should support filenames with commas in them.)
Steve, I actually think having a schema on configuration would make LDAP
support easier, not harder. For reasons of backwards compatibility, we're
going to support toString/fromString for a long time, and if you know what
you're storing, the mapping functions to/from LDAP are going to be considerably
easier to write.
-- Philip
> Support units for configuration knobs
> -------------------------------------
>
> Key: HADOOP-6287
> URL: https://issues.apache.org/jira/browse/HADOOP-6287
> Project: Hadoop Common
> Issue Type: Improvement
> Components: conf
> Reporter: Arun C Murthy
> Assignee: Eli Collins
> Attachments: hadoop-6287-1.patch
>
>
> We should add support for units in our Configuration system so that we can
> specify values to be *1GB* or *1MB* rather than forcing every component which
> consumes such values to be aware of these.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.