[
https://issues.apache.org/jira/browse/HADOOP-6105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734532#action_12734532
]
V.V.Chaitanya Krishna commented on HADOOP-6105:
-----------------------------------------------
Assumptions/Requirements:
* Deprecated keys never occur in default.xml files.
* There won't be any storage for deprecated keys in the Configuration object.
Instead, new key mappings will be used.
* The precedence order is as follows:
*# Value which comes with the final attribute as true.
*# Value occurring with the deprecated key.
The following table depicts the various cases arising, keeping in view whether
the key in concern is final and if the key is deprecated:
*NOTE:*
# *Key* - the current key that is to be loaded in loadResource method. It can
be a deprecated key (*old*), key in default.xml (*key_default*) or key in
site.xml (*key_site*).
# *Prev. Occurrence* - The attribute which changed the value of the *Key* most
recently.
# *isFinal* - true if *Key* is having the _final_ property set to true.
# *isPrevFinal* - true if *Prev. Occurrence* is having the _final_ property
set to true.
# *Value* - Value to be expected after *Key* is loaded. It can be either of the
values corresponding to *old*, *key_default* or *key_site*.
# _warn_ - logs a warning message indicating that a final parameter is being
attempted to override.
Also, a warning message which indicates the usage of a deprecated key is logged
whenever *Key* is a deprecated one.
||Key||isFinal||Prev.Occurrence||isPrevFinal||Value||
|old|true|key_default|true|old|
|old|true|key_default|false|old|
|old|true|key_site|true|old|
|old|true|key_site|false|old|
|old|false|key_default|true|key_default (warn)|
|old|false|key_default|false|old|
|old|false|key_site|true|key_site (warn)|
|old|false|key_site|false|old|
|key_site|true|old|true|old|
|key_site|true|old|false|key_site|
|key_site|true|key_default|true|key_default (warn)|
|key_site|true|key_default|false|key_site|
|key_site|false|old|true|old|
|key_site|false|old|false|old|
|key_site|false|key_default|true|key_default (warn)|
|key_site|false|key_default|false|key_site|
> Provide a way to automatically handle backward compatibility of deprecated
> keys
> -------------------------------------------------------------------------------
>
> Key: HADOOP-6105
> URL: https://issues.apache.org/jira/browse/HADOOP-6105
> Project: Hadoop Common
> Issue Type: Improvement
> Components: conf
> Reporter: Hemanth Yamijala
>
> There are cases when we have had to deprecate configuration keys. Use cases
> include, changing the names of variables to better match intent, splitting a
> single parameter into two - for maps, reduces etc.
> In such cases, we typically provide a backwards compatible option for the old
> keys. The handling of such cases might typically be common enough to actually
> add support for it in a generic fashion in the Configuration class. Some
> initial discussion around this started in HADOOP-5919, but since the project
> split happened in between we decided to open this issue to fix it in common.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.