[
https://issues.apache.org/jira/browse/HADOOP-6420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791170#action_12791170
]
Chris Douglas commented on HADOOP-6420:
---------------------------------------
bq. What do you mean by "this class"? Configuration?
Yes.
bq. we also support users creating maps using the underlying properties (e.g.,
conf.set("foo.bar", "a"); conf.set("foo.baz", "b"); conf.getMap("foo")), I've
added a declareMap() method that adds the sentinel as well.
This is incoherent. Either the user can set and retrieve string\->string maps
from Configuration *or* this is offering an API to Configuration to address a
subset of its members behind a preferred interface (i.e. Map<String,String>).
In the latter case (_A_), a Map<String,String> wrapping a Configuration
instance admits the ad-hoc "map" creation outlined above. In the former case
(_B_), this should attempt to guarantee that the Map goes in and out of
Configuration without being interfered with, excluding this use case.
Given how general Configuration is, I don't see a way to enforce _B_ invariants
without having a blob as the value. If _A_ is the goal- because one wants to
add to this sub-map at different stages efficiently, add values via the wrapper
interface, or for some other reason- then _by definition_ it creates a sub-map
by being interpreted as one, not by declaration.
The implementation details of MAPREDUCE-1126- particularly those enforcing
backwards-compatibility- should not bleed into a general Configuration feature.
If the metadata API needs to set a sentinel value in the config, then it should
set it.
On v8:
# Two {{ConfigItemMap}}s are only equal if they come from the same
Configuration; sharing a prefix is insufficient
# What distinguishes {{lookup}} from {{Configuration.this.get(prefix +
subKey)}}?
# {{get}}/{{put}} should check for null, to avoid setting/seeking "prefix.null"
# Any particular reason {{putAll}} is unsupported?
# {{ConfigItemMap}} can be a stand-alone or static inner class in conf if (2)
is sufficient
> String-to-String Maps should be embeddable in Configuration
> -----------------------------------------------------------
>
> Key: HADOOP-6420
> URL: https://issues.apache.org/jira/browse/HADOOP-6420
> Project: Hadoop Common
> Issue Type: Improvement
> Components: conf
> Reporter: Aaron Kimball
> Assignee: Aaron Kimball
> Attachments: HADOOP-6420.2.patch, HADOOP-6420.3.patch,
> HADOOP-6420.4.patch, HADOOP-6420.5.patch, HADOOP-6420.6.patch,
> HADOOP-6420.7.patch, HADOOP-6420.8.patch, HADOOP-6420.patch
>
>
> Per MAPREDUCE-1126, we need to be able to take a map of (key, value) pairs
> and embed that inside a Configuration object.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.