Description
Currently, Hadoop will not trim name when putting a pair of k/v to property. But when loading configuration from file, names will be trimmed:
(In Configuration.java)
if ("name".equals(field.getTagName()) && field.hasChildNodes()) attr = StringInterner.weakIntern( ((Text)field.getFirstChild()).getData().trim()); if ("value".equals(field.getTagName()) && field.hasChildNodes()) value = StringInterner.weakIntern( ((Text)field.getFirstChild()).getData());
With this behavior, following steps will be problematic:
1. User incorrectly set " hadoop.key=value" (with a space before hadoop.key)
2. User try to get "hadoop.key", cannot get "value"
3. Serialize/deserialize configuration (Like what did in MR)
4. User try to get "hadoop.key", can get "value", which will make inconsistency problem.