Author: ddas
Date: Fri Apr 17 11:22:40 2009
New Revision: 765951
URL: http://svn.apache.org/viewvc?rev=765951&view=rev
Log:
HADOOP-5646. Fixes a problem in TestQueueCapacities. Contributed by Vinod
Kumar Vavilapalli.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestQueueCapacities.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=765951&r1=765950&r2=765951&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Apr 17 11:22:40 2009
@@ -1267,6 +1267,9 @@
HADOOP-5655. TestMRServerPorts fails on java.net.BindException. (Devaraj
Das via hairong)
+ HADOOP-5646. Fixes a problem in TestQueueCapacities.
+ (Vinod Kumar Vavilapalli via ddas)
+
Release 0.19.2 - Unreleased
BUG FIXES
Modified:
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java?rev=765951&r1=765950&r2=765951&view=diff
==============================================================================
---
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
(original)
+++
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
Fri Apr 17 11:22:40 2009
@@ -47,7 +47,6 @@
static final Log LOG = LogFactory.getLog(ClusterWithCapacityScheduler.class);
private MiniMRCluster mrCluster;
- private MiniDFSCluster dfsCluster;
private JobConf jobConf;
@@ -71,7 +70,7 @@
protected void startCluster(Properties clusterProperties,
Properties schedulerProperties)
throws IOException {
- startCluster(2, 2, clusterProperties, schedulerProperties);
+ startCluster(2, clusterProperties, schedulerProperties);
}
/**
@@ -81,12 +80,11 @@
* user provided properties are missing (null/empty)
*
* @param numTaskTrackers
- * @param numDataNodes
* @param clusterProperties
* @param schedulerProperties
* @throws IOException
*/
- protected void startCluster(int numTaskTrackers, int numDataNodes,
+ protected void startCluster(int numTaskTrackers,
Properties clusterProperties, Properties schedulerProperties)
throws IOException {
Thread.currentThread().setContextClassLoader(
@@ -99,7 +97,6 @@
clusterConf.set(key, (String) clusterProperties.get(key));
}
}
- dfsCluster = new MiniDFSCluster(clusterConf, numDataNodes, true, null);
if (schedulerProperties != null) {
setUpSchedulerConfigFile(schedulerProperties);
@@ -108,23 +105,22 @@
clusterConf.set("mapred.jobtracker.taskScheduler",
CapacityTaskScheduler.class.getName());
mrCluster =
- new MiniMRCluster(numTaskTrackers, dfsCluster.getFileSystem().getUri()
- .toString(), 1, null, null, clusterConf);
+ new MiniMRCluster(numTaskTrackers, "file:///", 1, null, null,
+ clusterConf);
this.jobConf = mrCluster.createJobConf(clusterConf);
}
private void setUpSchedulerConfigFile(Properties schedulerConfProps)
throws IOException {
- Configuration config = new Configuration(false);
-
- LocalFileSystem fs = FileSystem.getLocal(config);
+ LocalFileSystem fs = FileSystem.getLocal(new Configuration());
String myResourcePath = System.getProperty("test.build.data");
Path schedulerConfigFilePath =
new Path(myResourcePath, CapacitySchedulerConf.SCHEDULER_CONF_FILE);
OutputStream out = fs.create(schedulerConfigFilePath);
+ Configuration config = new Configuration(false);
for (Enumeration<?> e = schedulerConfProps.propertyNames(); e
.hasMoreElements();) {
String key = (String) e.nextElement();
@@ -141,9 +137,7 @@
}
private void cleanUpSchedulerConfigFile() throws IOException {
- Configuration config = new Configuration(false);
-
- LocalFileSystem fs = FileSystem.getLocal(config);
+ LocalFileSystem fs = FileSystem.getLocal(new Configuration());
String myResourcePath = System.getProperty("test.build.data");
Path schedulerConfigFilePath =
@@ -167,9 +161,6 @@
if (mrCluster != null) {
mrCluster.shutdown();
}
- if (dfsCluster != null) {
- dfsCluster.shutdown();
- }
}
/**
@@ -232,4 +223,4 @@
return super.findResource(name);
}
}
-}
\ No newline at end of file
+}
Modified:
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestQueueCapacities.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestQueueCapacities.java?rev=765951&r1=765950&r2=765951&view=diff
==============================================================================
---
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestQueueCapacities.java
(original)
+++
hadoop/core/trunk/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestQueueCapacities.java
Fri Apr 17 11:22:40 2009
@@ -51,7 +51,7 @@
clusterProps.put("mapred.tasktracker.reduce.tasks.maximum", String
.valueOf(3));
// cluster capacity 12 maps, 12 reduces
- startCluster(4, 2, clusterProps, schedulerProps);
+ startCluster(4, clusterProps, schedulerProps);
ControlledMapReduceJobRunner jobRunner =
ControlledMapReduceJobRunner.getControlledMapReduceJobRunner(
@@ -126,7 +126,7 @@
clusterProps.put("mapred.tasktracker.reduce.tasks.maximum", String
.valueOf(0));
// cluster capacity 12 maps, 0 reduces
- startCluster(4, 2, clusterProps, schedulerProps);
+ startCluster(4, clusterProps, schedulerProps);
singleQMultipleJobs1();
singleQMultipleJobs2();
@@ -166,7 +166,7 @@
// cluster capacity 10 maps, 10 reduces and 4 queues with capacities 1, 2,
// 3, 4 respectively.
- startCluster(5, 2, clusterProps, schedulerProps);
+ startCluster(5, clusterProps, schedulerProps);
multipleQsWithOneQBeyondCapacity(queues);
multipleQueuesWithinCapacities(queues);
@@ -437,4 +437,4 @@
numTasks += 1;
}
}
-}
\ No newline at end of file
+}