Return-Path: Delivered-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Received: (qmail 28826 invoked from network); 29 Oct 2010 01:36:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Oct 2010 01:36:06 -0000 Received: (qmail 7750 invoked by uid 500); 29 Oct 2010 01:36:06 -0000 Delivered-To: apmail-hadoop-mapreduce-commits-archive@hadoop.apache.org Received: (qmail 7706 invoked by uid 500); 29 Oct 2010 01:36:06 -0000 Mailing-List: contact mapreduce-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-dev@hadoop.apache.org Delivered-To: mailing list mapreduce-commits@hadoop.apache.org Received: (qmail 7698 invoked by uid 99); 29 Oct 2010 01:36:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Oct 2010 01:36:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Oct 2010 01:36:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D805B23888FE; Fri, 29 Oct 2010 01:35:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1028584 - in /hadoop/mapreduce/trunk: CHANGES.txt src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java Date: Fri, 29 Oct 2010 01:35:09 -0000 To: mapreduce-commits@hadoop.apache.org From: schen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101029013509.D805B23888FE@eris.apache.org> Author: schen Date: Fri Oct 29 01:35:09 2010 New Revision: 1028584 URL: http://svn.apache.org/viewvc?rev=1028584&view=rev Log: MAPREDUCE-1818. RaidNode can specify scheduling parameters. (Ramkumar Vadali via schen) Modified: hadoop/mapreduce/trunk/CHANGES.txt hadoop/mapreduce/trunk/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java hadoop/mapreduce/trunk/src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java Modified: hadoop/mapreduce/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1028584&r1=1028583&r2=1028584&view=diff ============================================================================== --- hadoop/mapreduce/trunk/CHANGES.txt (original) +++ hadoop/mapreduce/trunk/CHANGES.txt Fri Oct 29 01:35:09 2010 @@ -149,6 +149,9 @@ Trunk (unreleased changes) HADOOP-7007. Update the hudson-test-patch ant target to work with the latest test-patch.sh script (gkesavan) + MAPREDUCE-1818. RaidNode can specify scheduling parameters. (Ramkumar + Vadali via schen) + OPTIMIZATIONS MAPREDUCE-1354. Enhancements to JobTracker for better performance and Modified: hadoop/mapreduce/trunk/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java?rev=1028584&r1=1028583&r2=1028584&view=diff ============================================================================== --- hadoop/mapreduce/trunk/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java (original) +++ hadoop/mapreduce/trunk/src/contrib/raid/src/java/org/apache/hadoop/raid/DistRaid.java Fri Oct 29 01:35:09 2010 @@ -249,16 +249,35 @@ public class DistRaid { } /** + * Set options specified in raid.scheduleroption. + * The string should be formatted as key:value[,key:value]* + */ + static void setSchedulerOption(Configuration conf) { + String schedulerOption = conf.get("raid.scheduleroption"); + if (schedulerOption != null) { + // Parse the scheduler option to get key:value pairs. + String[] keyValues = schedulerOption.trim().split(","); + for (String keyValue: keyValues) { + String[] fields = keyValue.trim().split(":"); + String key = fields[0].trim(); + String value = fields[1].trim(); + conf.set(key, value); + } + } + } + + /** * create new job conf based on configuration passed. * * @param conf * @return */ - private static JobConf createJobConf(Configuration conf) { + static JobConf createJobConf(Configuration conf) { JobConf jobconf = new JobConf(conf, DistRaid.class); jobName = NAME + " " + dateForm.format(new Date(RaidNode.now())); jobconf.setJobName(jobName); jobconf.setMapSpeculativeExecution(false); + setSchedulerOption(jobconf); jobconf.setJarByClass(DistRaid.class); jobconf.setInputFormat(DistRaidInputFormat.class); Modified: hadoop/mapreduce/trunk/src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java?rev=1028584&r1=1028583&r2=1028584&view=diff ============================================================================== --- hadoop/mapreduce/trunk/src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java (original) +++ hadoop/mapreduce/trunk/src/contrib/raid/src/test/org/apache/hadoop/raid/TestRaidNode.java Fri Oct 29 01:35:09 2010 @@ -655,4 +655,13 @@ public class TestRaidNode extends TestCa } LOG.info("Test testSuspendTraversal completed."); } + + public void testSchedulerOption() { + Configuration conf = new Configuration(); + conf.set("raid.scheduleroption", + "mapred.fairscheduler.pool:dummy,foo:bar"); + org.apache.hadoop.mapred.JobConf jobConf = DistRaid.createJobConf(conf); + assertEquals("dummy", jobConf.get("mapred.fairscheduler.pool")); + assertEquals("bar", jobConf.get("foo")); + } }