MAPREDUCE-6022. map_input_file is missing from streaming job
environment. Contributed by Jason Lowe.
(cherry picked from commit b056048114
)
This commit is contained in:
parent
6add7b19f6
commit
afbb279825
|
@ -558,6 +558,32 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
|
||||||
return deprecationContext.get().getDeprecatedKeyMap().containsKey(key);
|
return deprecationContext.get().getDeprecatedKeyMap().containsKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets all deprecated properties that are not currently set but have a
|
||||||
|
* corresponding new property that is set. Useful for iterating the
|
||||||
|
* properties when all deprecated properties for currently set properties
|
||||||
|
* need to be present.
|
||||||
|
*/
|
||||||
|
public void setDeprecatedProperties() {
|
||||||
|
DeprecationContext deprecations = deprecationContext.get();
|
||||||
|
Properties props = getProps();
|
||||||
|
Properties overlay = getOverlay();
|
||||||
|
for (Map.Entry<String, DeprecatedKeyInfo> entry :
|
||||||
|
deprecations.getDeprecatedKeyMap().entrySet()) {
|
||||||
|
String depKey = entry.getKey();
|
||||||
|
if (!overlay.contains(depKey)) {
|
||||||
|
for (String newKey : entry.getValue().newKeys) {
|
||||||
|
String val = overlay.getProperty(newKey);
|
||||||
|
if (val != null) {
|
||||||
|
props.setProperty(depKey, val);
|
||||||
|
overlay.setProperty(depKey, val);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for the presence of the property <code>name</code> in the
|
* Checks for the presence of the property <code>name</code> in the
|
||||||
* deprecation map. Returns the first of the list of new keys if present
|
* deprecation map. Returns the first of the list of new keys if present
|
||||||
|
|
|
@ -216,6 +216,9 @@ Release 2.6.0 - UNRELEASED
|
||||||
MAPREDUCE-6142. Fixed test failures in TestJobHistoryEventHandler and
|
MAPREDUCE-6142. Fixed test failures in TestJobHistoryEventHandler and
|
||||||
TestMRTimelineEventHandling. (Zhijie Shen via vinodkv)
|
TestMRTimelineEventHandling. (Zhijie Shen via vinodkv)
|
||||||
|
|
||||||
|
MAPREDUCE-6022. map_input_file is missing from streaming job environment.
|
||||||
|
(jlowe via kihwal)
|
||||||
|
|
||||||
Release 2.5.1 - 2014-09-05
|
Release 2.5.1 - 2014-09-05
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -235,7 +235,9 @@ public abstract class PipeMapRed {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void addJobConfToEnvironment(JobConf conf, Properties env) {
|
void addJobConfToEnvironment(JobConf jobconf, Properties env) {
|
||||||
|
JobConf conf = new JobConf(jobconf);
|
||||||
|
conf.setDeprecatedProperties();
|
||||||
Iterator it = conf.iterator();
|
Iterator it = conf.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Map.Entry en = (Map.Entry) it.next();
|
Map.Entry en = (Map.Entry) it.next();
|
||||||
|
|
|
@ -57,6 +57,9 @@ public class TrApp
|
||||||
// the FileSplit context properties are not available in local hadoop..
|
// the FileSplit context properties are not available in local hadoop..
|
||||||
// so can't check them in this test.
|
// so can't check them in this test.
|
||||||
|
|
||||||
|
// verify some deprecated properties appear for older stream jobs
|
||||||
|
expect("map_input_file", env.getProperty("mapreduce_map_input_file"));
|
||||||
|
expect("map_input_length", env.getProperty("mapreduce_map_input_length"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// this runs in a subprocess; won't use JUnit's assertTrue()
|
// this runs in a subprocess; won't use JUnit's assertTrue()
|
||||||
|
|
Loading…
Reference in New Issue