MAPREDUCE-3543. Mavenize Gridmix. (tgraves)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1339652 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Graves 2012-05-17 15:31:19 +00:00
parent 1faa95d662
commit b35de62e1d
66 changed files with 150 additions and 6 deletions

View File

@ -396,6 +396,8 @@ Release 0.23.3 - UNRELEASED
MAPREDUCE-4102. job counters not available in Jobhistory webui for MAPREDUCE-4102. job counters not available in Jobhistory webui for
killed jobs (Bhallamudi Venkata Siva Kamesh via tgraves) killed jobs (Bhallamudi Venkata Siva Kamesh via tgraves)
MAPREDUCE-3543. Mavenize Gridmix. (tgraves)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -215,6 +215,11 @@
<artifactId>hadoop-mapreduce-examples</artifactId> <artifactId>hadoop-mapreduce-examples</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-gridmix</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-project</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath>../../hadoop-project</relativePath>
</parent>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-gridmix</artifactId>
<version>2.0.1-SNAPSHOT</version>
<description>Apache Hadoop Gridmix</description>
<name>Apache Hadoop Gridmix</name>
<packaging>jar</packaging>
<properties>
<hadoop.log.dir>${project.build.directory}/log</hadoop.log.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-hs</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-rumen</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-tests</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-log-dir</id>
<phase>process-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${test.build.data}"/>
<mkdir dir="${test.build.data}"/>
<mkdir dir="${hadoop.log.dir}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.apache.hadoop.tools.HadoopArchives</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -23,7 +23,6 @@
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.mapred.JobTracker;
import org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats; import org.apache.hadoop.mapred.gridmix.Statistics.ClusterStats;
import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig; import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
@ -114,4 +113,4 @@ protected String getJobTrackerInfo() {
protected String getNamenodeInfo() { protected String getNamenodeInfo() {
return namenodeInfo; return namenodeInfo;
} }
} }

View File

@ -1,5 +1,7 @@
package org.apache.hadoop.mapred.gridmix; package org.apache.hadoop.mapred.gridmix;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.CommonConfigurationKeys;
@ -32,6 +34,7 @@
* limitations under the License. * limitations under the License.
*/ */
public class GridmixTestUtils { public class GridmixTestUtils {
private static final Log LOG = LogFactory.getLog(GridmixTestUtils.class);
static final Path DEST = new Path("/gridmix"); static final Path DEST = new Path("/gridmix");
static FileSystem dfs = null; static FileSystem dfs = null;
static MiniDFSCluster dfsCluster = null; static MiniDFSCluster dfsCluster = null;
@ -69,15 +72,13 @@ public static void createHomeAndStagingDirectory(String user, JobConf conf) {
if(fs.exists(homeDirectory)) { if(fs.exists(homeDirectory)) {
fs.delete(homeDirectory,true); fs.delete(homeDirectory,true);
} }
TestGridmixSubmission.LOG.info( LOG.info("Creating Home directory : " + homeDirectory);
"Creating Home directory : " + homeDirectory);
fs.mkdirs(homeDirectory); fs.mkdirs(homeDirectory);
changePermission(user,homeDirectory, fs); changePermission(user,homeDirectory, fs);
Path stagingArea = Path stagingArea =
new Path(conf.get("mapreduce.jobtracker.staging.root.dir", new Path(conf.get("mapreduce.jobtracker.staging.root.dir",
"/tmp/hadoop/mapred/staging")); "/tmp/hadoop/mapred/staging"));
TestGridmixSubmission.LOG.info( LOG.info("Creating Staging root directory : " + stagingArea);
"Creating Staging root directory : " + stagingArea);
fs.mkdirs(stagingArea); fs.mkdirs(stagingArea);
fs.setPermission(stagingArea, new FsPermission((short) 0777)); fs.setPermission(stagingArea, new FsPermission((short) 0777));
} catch (IOException ioe) { } catch (IOException ioe) {

View File

@ -62,6 +62,11 @@
<artifactId>hadoop-extras</artifactId> <artifactId>hadoop-extras</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-gridmix</artifactId>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -32,6 +32,7 @@
<module>hadoop-distcp</module> <module>hadoop-distcp</module>
<module>hadoop-archives</module> <module>hadoop-archives</module>
<module>hadoop-rumen</module> <module>hadoop-rumen</module>
<module>hadoop-gridmix</module>
<module>hadoop-datajoin</module> <module>hadoop-datajoin</module>
<module>hadoop-tools-dist</module> <module>hadoop-tools-dist</module>
<module>hadoop-extras</module> <module>hadoop-extras</module>