[ https://issues.apache.org/jira/browse/HADOOP-6420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aaron Kimball updated HADOOP-6420: ---------------------------------- Attachment: HADOOP-6420.8.patch I realized after working more on MAPREDUCE-1126 that I need the ability to determine if a map is empty or not; when I was using the HashMap-based (deep-copy) getMap(), this was accomplished via {{Map.size() == 0}}; but determining the map's size in general requires iteration, which we decided not to support due to the expense. Instead I've added a sentinel value that indicates whether the map exists or not. This is set by {{setMap()}} and can be read with {{mapExists()}}. Since 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. (so you could write: {{conf.set("foo.bar", "a"); conf.set("foo.baz", "b"); conf.declareMap("foo"); assertTrue(conf.mapExists("foo")}}). This works by creating a key named {{"foo"}} in the Configuration whose value is {{"$MAP$"}}. This is necessary in MAPREDUCE-1126 to determine whether the user has properly called a metadata-API {{setMapOutputKeyClass() / setMapOutputKeySchema()}} method, or whether we should fall back to the deprecated {{JobConf.getMapOutputKeyClass() / JobConf.getOutputKeyClass()}} API. > 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.