You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by tu...@apache.org on 2012/11/27 21:19:27 UTC
svn commit: r1414371 - in /oozie/branches/branch-3.3:
core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java
core/src/main/resources/oozie-default.xml
core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java
release-log.txt
Author: tucu
Date: Tue Nov 27 20:19:26 2012
New Revision: 1414371
URL: http://svn.apache.org/viewvc?rev=1414371&view=rev
Log:
OOZIE-1089 DistributedCache workaround for Hadoop 2.0.2-alpha (tucu)
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java
oozie/branches/branch-3.3/core/src/main/resources/oozie-default.xml
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java
oozie/branches/branch-3.3/release-log.txt
Modified: oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java?rev=1414371&r1=1414370&r2=1414371&view=diff
==============================================================================
--- oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java (original)
+++ oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java Tue Nov 27 20:19:26 2012
@@ -33,6 +33,9 @@ import java.lang.reflect.Method;
import java.net.URI;
import java.security.Permission;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -201,6 +204,18 @@ public class LauncherMapper<K1, V1, K2,
actionConf.set(OOZIE_JOB_ID, jobId);
actionConf.set(OOZIE_ACTION_ID, actionId);
+ if (Services.get().getConf().getBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", false)) {
+ List<String> purgedEntries = new ArrayList<String>();
+ Collection<String> entries = actionConf.getStringCollection("mapreduce.job.cache.files");
+ for (String entry : entries) {
+ if (entry.contains("#")) {
+ purgedEntries.add(entry);
+ }
+ }
+ actionConf.setStrings("mapreduce.job.cache.files", purgedEntries.toArray(new String[purgedEntries.size()]));
+ launcherConf.setBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", true);
+ }
+
FileSystem fs =
Services.get().get(HadoopAccessorService.class).createFileSystem(launcherConf.get("user.name"),
actionDir.toUri(), launcherConf);
@@ -398,6 +413,9 @@ public class LauncherMapper<K1, V1, K2,
}
else {
String mainClass = getJobConf().get(CONF_OOZIE_ACTION_MAIN_CLASS);
+ if (getJobConf().getBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", false)) {
+ System.err.println("WARNING, workaround for Hadoop 2.0.2-alpha distributed cached issue (MAPREDUCE-4820) enabled");
+ }
String msgPrefix = "Main class [" + mainClass + "], ";
int errorCode = 0;
Throwable errorCause = null;
Modified: oozie/branches/branch-3.3/core/src/main/resources/oozie-default.xml
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/main/resources/oozie-default.xml?rev=1414371&r1=1414370&r2=1414371&view=diff
==============================================================================
--- oozie/branches/branch-3.3/core/src/main/resources/oozie-default.xml (original)
+++ oozie/branches/branch-3.3/core/src/main/resources/oozie-default.xml Tue Nov 27 20:19:26 2012
@@ -1649,4 +1649,18 @@
then ALL file schemes will be allowed.
</description>
</property>
+
+ <!-- Enable Distributed Cache workaround for Hadoop 2.0.2-alpha (MAPREDUCE-4820) -->
+ <property>
+ <name>oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache</name>
+ <value>false</value>
+ <description>
+ Due to a bug in Hadoop 2.0.2-alpha, MAPREDUCE-4820, launcher jobs fail to set
+ the distributed cache for the action job because the local JARs are implicitly
+ included triggering a duplicate check.
+ This flag removes the distributed cache files for the action as they'll be
+ included from the local JARs of the JobClient (MRApps) submitting the action
+ job from the launcher.
+ </description>
+ </property>
</configuration>
Modified: oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java?rev=1414371&r1=1414370&r2=1414371&view=diff
==============================================================================
--- oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java (original)
+++ oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java Tue Nov 27 20:19:26 2012
@@ -294,4 +294,34 @@ public class TestLauncher extends XFsTes
lm.setupLauncherInfo(jobConf, "1", "1@a", actionDir, "1@a-0", actionConf, prepareBlock);
assertTrue(jobConf.get("oozie.action.prepare.xml").equals(prepareBlock));
}
+
+ // Test to ensure that the property value "oozie.action.prepare.xml" in the configuration of the job is properly set
+ // when there is prepare block in workflow XML
+ public void testSetupLauncherInfoHadoop2_0_2_alphaWorkaround() throws Exception {
+ Path actionDir = getFsTestCaseDir();
+ FileSystem fs = getFileSystem();
+ Path newDir = new Path(actionDir, "newDir");
+
+ // Setting up the job configuration
+ JobConf jobConf = Services.get().get(HadoopAccessorService.class).
+ createJobConf(new URI(getNameNodeUri()).getAuthority());
+ jobConf.set("user.name", getTestUser());
+ jobConf.set("fs.default.name", getNameNodeUri());
+
+ LauncherMapper lm = new LauncherMapper();
+ Configuration actionConf = new XConfiguration();
+ actionConf.set("mapreduce.job.cache.files", "a.jar,aa.jar#aa.jar");
+ lm.setupLauncherInfo(jobConf, "1", "1@a", actionDir, "1@a-0", actionConf, "");
+ assertFalse(jobConf.getBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", false));
+ assertEquals("a.jar,aa.jar#aa.jar", actionConf.get("mapreduce.job.cache.files"));
+
+ Services.get().getConf().setBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", true);
+ lm = new LauncherMapper();
+ actionConf = new XConfiguration();
+ actionConf.set("mapreduce.job.cache.files", "a.jar,aa.jar#aa.jar");
+ lm.setupLauncherInfo(jobConf, "1", "1@a", actionDir, "1@a-0", actionConf, "");
+ assertTrue(jobConf.getBoolean("oozie.hadoop-2.0.2-alpha.workaround.for.distributed.cache", false));
+ assertEquals("aa.jar#aa.jar", actionConf.get("mapreduce.job.cache.files"));
+ }
+
}
Modified: oozie/branches/branch-3.3/release-log.txt
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/release-log.txt?rev=1414371&r1=1414370&r2=1414371&view=diff
==============================================================================
--- oozie/branches/branch-3.3/release-log.txt (original)
+++ oozie/branches/branch-3.3/release-log.txt Tue Nov 27 20:19:26 2012
@@ -1,5 +1,6 @@
-- Oozie 3.3.0 release
+OOZIE-1089 DistributedCache workaround for Hadoop 2.0.2-alpha (tucu)
OOZIE-1005 Tests from OOZIE-994 use wrong condition in waitFor (rkanter via virag)
OOZIE-994 ActionCheckXCommand does not handle failures properly(rkanter via mohammad)
OOZIE-1058 ACL modify-job should not be hardcoded to group name(mona via mohammad)