|
@@ -345,7 +345,17 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
|
|
|
}
|
|
|
return name;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ private void handleDeprecation() {
|
|
|
+ LOG.debug("Handling deprecation for all properties in config...");
|
|
|
+ Set<Object> keys = new HashSet<Object>();
|
|
|
+ keys.addAll(getProps().keySet());
|
|
|
+ for (Object item: keys) {
|
|
|
+ LOG.debug("Handling deprecation for " + (String)item);
|
|
|
+ handleDeprecation((String)item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
static{
|
|
|
//print deprecation warning if hadoop-site.xml is found in classpath
|
|
|
ClassLoader cL = Thread.currentThread().getContextClassLoader();
|
|
@@ -1665,7 +1675,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
|
|
|
Element conf = doc.createElement("configuration");
|
|
|
doc.appendChild(conf);
|
|
|
conf.appendChild(doc.createTextNode("\n"));
|
|
|
- getProps(); // ensure properties is set
|
|
|
+ handleDeprecation(); //ensure properties is set and deprecation is handled
|
|
|
for (Enumeration e = properties.keys(); e.hasMoreElements();) {
|
|
|
String name = (String)e.nextElement();
|
|
|
Object object = properties.get(name);
|