MAPREDUCE-3370. Fixed MiniMRYarnCluster and related tests to not use a hard-coded path for the mr-app jar. Contributed by Ahmed Radwan.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1200768 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dbc82dbdfb
commit
9c17410c50
@ -73,6 +73,9 @@ Release 0.23.1 - Unreleased
|
|||||||
MAPREDUCE-3280. Removed the unnecessary job user-name configuration in
|
MAPREDUCE-3280. Removed the unnecessary job user-name configuration in
|
||||||
mapred-site.xml. (vinodkv)
|
mapred-site.xml. (vinodkv)
|
||||||
|
|
||||||
|
MAPREDUCE-3370. Fixed MiniMRYarnCluster and related tests to not use
|
||||||
|
a hard-coded path for the mr-app jar. (Ahmed Radwan via vinodkv)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
@ -1833,7 +1833,7 @@ int computeNumSlotsPerReduce(long slotSizePerReduce) {
|
|||||||
* @return a jar file that contains the class, or null.
|
* @return a jar file that contains the class, or null.
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
static String findContainingJar(Class my_class) {
|
public static String findContainingJar(Class my_class) {
|
||||||
ClassLoader loader = my_class.getClassLoader();
|
ClassLoader loader = my_class.getClassLoader();
|
||||||
String class_file = my_class.getName().replaceAll("\\.", "/") + ".class";
|
String class_file = my_class.getName().replaceAll("\\.", "/") + ".class";
|
||||||
try {
|
try {
|
||||||
|
@ -101,6 +101,9 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<yarn.mr.jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</yarn.mr.jar>
|
||||||
|
</systemPropertyVariables>
|
||||||
<additionalClasspathElements>
|
<additionalClasspathElements>
|
||||||
<!-- workaround for JobConf#setJarByClass -->
|
<!-- workaround for JobConf#setJarByClass -->
|
||||||
<additionalClasspathElement>${project.build.directory}/${project.artifactId}-${project.version}-tests.jar</additionalClasspathElement>
|
<additionalClasspathElement>${project.build.directory}/${project.artifactId}-${project.version}-tests.jar</additionalClasspathElement>
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.mapred.JobConf;
|
||||||
|
import org.apache.hadoop.mapred.LocalContainerLauncher;
|
||||||
import org.apache.hadoop.mapred.ShuffleHandler;
|
import org.apache.hadoop.mapred.ShuffleHandler;
|
||||||
import org.apache.hadoop.mapreduce.MRConfig;
|
import org.apache.hadoop.mapreduce.MRConfig;
|
||||||
import org.apache.hadoop.mapreduce.MRJobConfig;
|
import org.apache.hadoop.mapreduce.MRJobConfig;
|
||||||
@ -49,9 +51,8 @@ public class MiniMRYarnCluster extends MiniYARNCluster {
|
|||||||
public static final String YARN_MAPREDUCE_APP_JAR_PATH =
|
public static final String YARN_MAPREDUCE_APP_JAR_PATH =
|
||||||
"$YARN_HOME/modules/" + HADOOP_MAPREDUCE_CLIENT_APP_JAR_NAME;
|
"$YARN_HOME/modules/" + HADOOP_MAPREDUCE_CLIENT_APP_JAR_NAME;
|
||||||
|
|
||||||
public static final String APPJAR =
|
public static final String APPJAR = System.getProperty("yarn.mr.jar", JobConf
|
||||||
"../hadoop-mapreduce-client-app/target/"
|
.findContainingJar(LocalContainerLauncher.class));
|
||||||
+ HADOOP_MAPREDUCE_CLIENT_APP_JAR_NAME;
|
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(MiniMRYarnCluster.class);
|
private static final Log LOG = LogFactory.getLog(MiniMRYarnCluster.class);
|
||||||
private JobHistoryServer historyServer;
|
private JobHistoryServer historyServer;
|
||||||
|
@ -58,6 +58,12 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
<artifactId>hadoop-mapreduce-client-core</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-yarn-server-tests</artifactId>
|
<artifactId>hadoop-yarn-server-tests</artifactId>
|
||||||
@ -99,6 +105,15 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<yarn.ds.jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</yarn.ds.jar>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.mapred.JobConf;
|
||||||
import org.apache.hadoop.yarn.server.MiniYARNCluster;
|
import org.apache.hadoop.yarn.server.MiniYARNCluster;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
@ -36,7 +37,8 @@ public class TestDistributedShell {
|
|||||||
protected static MiniYARNCluster yarnCluster = null;
|
protected static MiniYARNCluster yarnCluster = null;
|
||||||
protected static Configuration conf = new Configuration();
|
protected static Configuration conf = new Configuration();
|
||||||
|
|
||||||
protected static String APPMASTER_JAR = "../hadoop-yarn-applications-distributedshell/target/hadoop-yarn-applications-distributedshell-0.24.0-SNAPSHOT.jar";
|
protected static String APPMASTER_JAR = System.getProperty("yarn.ds.jar",
|
||||||
|
JobConf.findContainingJar(ApplicationMaster.class));
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup() throws InterruptedException, IOException {
|
public static void setup() throws InterruptedException, IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user