Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closes OOZIE-118 fix pipes program accept relative path

  • Loading branch information...
commit 31586bb7a00874290fc1e3b612f84c860046a98f 1 parent 2132585
Angelo Kaichen Huang authored bansalmayank committed
View
5 core/src/main/java/org/apache/oozie/action/hadoop/MapReduceActionExecutor.java
@@ -41,6 +41,7 @@ public MapReduceActionExecutor() {
super("map-reduce");
}
+ @Override
protected List<Class> getLauncherClasses() {
List<Class> classes = super.getLauncherClasses();
classes.add(LauncherMain.class);
@@ -50,6 +51,7 @@ public MapReduceActionExecutor() {
return classes;
}
+ @Override
protected String getLauncherMain(Configuration launcherConf, Element actionXml) {
String mainClass;
Namespace ns = actionXml.getNamespace();
@@ -74,6 +76,7 @@ Configuration setupLauncherConf(Configuration conf, Element actionXml, Path appP
return conf;
}
+ @Override
@SuppressWarnings("unchecked")
Configuration setupActionConf(Configuration actionConf, Context context, Element actionXml, Path appPath)
throws ActionExecutorException {
@@ -104,7 +107,7 @@ Configuration setupActionConf(Configuration actionConf, Context context, Element
String partitioner = pipesXml.getChildTextTrim("partitioner", ns);
String writer = pipesXml.getChildTextTrim("writer", ns);
String program = pipesXml.getChildTextTrim("program", ns);
- PipesMain.setPipes(actionConf, map, reduce, inputFormat, partitioner, writer, program);
+ PipesMain.setPipes(actionConf, map, reduce, inputFormat, partitioner, writer, program, appPath);
}
}
actionConf = super.setupActionConf(actionConf, context, actionXml, appPath);
View
10 core/src/main/java/org/apache/oozie/action/hadoop/PipesMain.java
@@ -19,6 +19,7 @@
import org.apache.hadoop.mapred.RunningJob;
import org.apache.hadoop.mapred.pipes.Submitter;
import org.apache.hadoop.filecache.DistributedCache;
+import org.apache.hadoop.fs.Path;
public class PipesMain extends MapReduceMain {
@@ -26,6 +27,7 @@ public static void main(String[] args) throws Exception {
run(PipesMain.class, args);
}
+ @Override
protected RunningJob submitJob(Configuration actionConf) throws Exception {
JobConf jobConf = new JobConf();
@@ -72,7 +74,7 @@ protected RunningJob submitJob(Configuration actionConf) throws Exception {
}
public static void setPipes(Configuration conf, String map, String reduce, String inputFormat, String partitioner,
- String writer, String program) {
+ String writer, String program, Path appPath) {
if (map != null) {
conf.set("oozie.pipes.map", map);
}
@@ -89,7 +91,13 @@ public static void setPipes(Configuration conf, String map, String reduce, Strin
conf.set("oozie.pipes.writer", writer);
}
if (program != null) {
+ Path path = null;
+ if (!program.startsWith("/")) {
+ path = new Path(appPath, program);
+ program = path.toString();
+ }
conf.set("oozie.pipes.program", program);
+
}
}
View
2  core/src/test/java/org/apache/oozie/action/hadoop/TestMapReduceActionError.java
@@ -151,7 +151,7 @@ public void testSetupMethods() throws Exception {
assertEquals("IF", conf.get("oozie.pipes.inputformat"));
assertEquals("P", conf.get("oozie.pipes.partitioner"));
assertEquals("W", conf.get("oozie.pipes.writer"));
- assertEquals("PP", conf.get("oozie.pipes.program"));
+ assertEquals(getFsTestCaseDir()+"/PP", conf.get("oozie.pipes.program"));
}
private Context createContext(String actionXml) throws Exception {
View
2  core/src/test/java/org/apache/oozie/action/hadoop/TestMapReduceActionExecutor.java
@@ -133,7 +133,7 @@ public void testSetupMethods() throws Exception {
assertEquals("IF", conf.get("oozie.pipes.inputformat"));
assertEquals("P", conf.get("oozie.pipes.partitioner"));
assertEquals("W", conf.get("oozie.pipes.writer"));
- assertEquals("PP", conf.get("oozie.pipes.program"));
+ assertEquals(getFsTestCaseDir()+"/PP", conf.get("oozie.pipes.program"));
}
protected Context createContext(String name, String actionXml) throws Exception {
View
1  release-log.txt
@@ -18,6 +18,7 @@ OOZIE-108 Upgrade pom version to 3.1.0.
-- Oozie 3.0.2 release
+OOZIE-118 fix pipes program accept relative path
OOZIE-120 coordinator resolve config default variable
OOZIE-119 relative path in coord dataset include should throw exception if given
OOZIE-115 oozie should check if app path is directory and read the app xml under it
Please sign in to comment.
Something went wrong with that request. Please try again.