Skip to content

Commit 0c06355

Browse files
committed
HADOOP-9656. Merging change r1496600 from branch-2 to branch-2.1-beta.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1496602 13f79535-47bb-0310-9956-ffa450edef68
1 parent e08ae01 commit 0c06355

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ Release 2.1.0-beta - UNRELEASED
259259
HADOOP-9439. JniBasedUnixGroupsMapping: fix some crash bugs. (Colin
260260
Patrick McCabe)
261261

262+
HADOOP-9656. Gridmix unit tests fail on Windows and Linux. (Chuan Liu via
263+
cnauroth)
264+
262265
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
263266

264267
HADOOP-8924. Hadoop Common creating package-info.java must not depend on

hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ class GenerateDistCacheData extends GridmixJob {
8686
"gridmix.distcache.file.list";
8787
static final String JOB_NAME = "GRIDMIX_GENERATE_DISTCACHE_DATA";
8888

89+
/**
90+
* Create distributed cache file with the permissions 0644.
91+
* Since the private distributed cache directory doesn't have execute
92+
* permission for others, it is OK to set read permission for others for
93+
* the files under that directory and still they will become 'private'
94+
* distributed cache files on the simulated cluster.
95+
*/
96+
static final short GRIDMIX_DISTCACHE_FILE_PERM = 0644;
97+
8998
public GenerateDistCacheData(Configuration conf) throws IOException {
9099
super(conf, 0L, JOB_NAME);
91100
}
@@ -146,15 +155,8 @@ public void map(LongWritable key, BytesWritable value, Context context)
146155
String fileName = new String(value.getBytes(), 0, value.getLength());
147156
Path path = new Path(fileName);
148157

149-
/**
150-
* Create distributed cache file with the permissions 0755.
151-
* Since the private distributed cache directory doesn't have execute
152-
* permission for others, it is OK to set read permission for others for
153-
* the files under that directory and still they will become 'private'
154-
* distributed cache files on the simulated cluster.
155-
*/
156158
FSDataOutputStream dos =
157-
FileSystem.create(fs, path, new FsPermission((short)0755));
159+
FileSystem.create(fs, path, new FsPermission(GRIDMIX_DISTCACHE_FILE_PERM));
158160

159161
int size = 0;
160162
for (long bytes = key.get(); bytes > 0; bytes -= size) {

hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/GridmixJob.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static void configureHighRamProperties(Configuration sourceConf,
311311
// set the memory per map task
312312
scaleConfigParameter(sourceConf, destConf,
313313
MRConfig.MAPMEMORY_MB, MRJobConfig.MAP_MEMORY_MB,
314-
JobConf.DISABLED_MEMORY_LIMIT);
314+
MRJobConfig.DEFAULT_MAP_MEMORY_MB);
315315

316316
// validate and fail early
317317
validateTaskMemoryLimits(destConf, MRJobConfig.MAP_MEMORY_MB,
@@ -320,7 +320,7 @@ static void configureHighRamProperties(Configuration sourceConf,
320320
// set the memory per reduce task
321321
scaleConfigParameter(sourceConf, destConf,
322322
MRConfig.REDUCEMEMORY_MB, MRJobConfig.REDUCE_MEMORY_MB,
323-
JobConf.DISABLED_MEMORY_LIMIT);
323+
MRJobConfig.DEFAULT_REDUCE_MEMORY_MB);
324324
// validate and fail early
325325
validateTaskMemoryLimits(destConf, MRJobConfig.REDUCE_MEMORY_MB,
326326
JTConfig.JT_MAX_REDUCEMEMORY_MB);

hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/CommonJobTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ protected void doSubmission(String jobCreatorName, boolean defaultOutputPath)
327327
final Path out = GridmixTestUtils.DEST.makeQualified(
328328
GridmixTestUtils.dfs.getUri(),
329329
GridmixTestUtils.dfs.getWorkingDirectory());
330-
final Path root = new Path(workspace.getAbsolutePath());
330+
final Path root = new Path(workspace.getName()).makeQualified(
331+
GridmixTestUtils.dfs.getUri(), GridmixTestUtils.dfs.getWorkingDirectory());
331332
if (!workspace.exists()) {
332333
assertTrue(workspace.mkdirs());
333334
}

hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ private void validateDistCacheFiles(List<Long> filesSizesExpected, Path distCach
134134

135135
FsPermission perm = stat.getPermission();
136136
assertEquals("Wrong permissions for distributed cache file "
137-
+ stat.getPath().toUri().getPath(), new FsPermission((short) 0644),
138-
perm);
137+
+ stat.getPath().toUri().getPath(), new FsPermission(
138+
GenerateDistCacheData.GRIDMIX_DISTCACHE_FILE_PERM), perm);
139139
}
140140
}
141141

0 commit comments

Comments
 (0)