Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 65547 invoked from network); 12 Jan 2009 15:34:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jan 2009 15:34:30 -0000 Received: (qmail 87109 invoked by uid 500); 12 Jan 2009 15:34:24 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 87022 invoked by uid 500); 12 Jan 2009 15:34:24 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 87001 invoked by uid 99); 12 Jan 2009 15:34:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2009 07:34:23 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2009 15:34:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D4323234C4AA for ; Mon, 12 Jan 2009 07:34:00 -0800 (PST) Message-ID: <1299336898.1231774440868.JavaMail.jira@brutus> Date: Mon, 12 Jan 2009 07:34:00 -0800 (PST) From: "Owen O'Malley (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-5003) When computing absoluet guaranteed capacity (GC) from a percent value, Capacity Scheduler should round up floats, rather than truncate them. In-Reply-To: <609316140.1231506839593.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-5003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Owen O'Malley updated HADOOP-5003: ---------------------------------- Component/s: contrib/capacity-sched > When computing absoluet guaranteed capacity (GC) from a percent value, Capacity Scheduler should round up floats, rather than truncate them. > -------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HADOOP-5003 > URL: https://issues.apache.org/jira/browse/HADOOP-5003 > Project: Hadoop Core > Issue Type: Bug > Components: contrib/capacity-sched > Reporter: Vivek Ratan > Priority: Minor > > The Capacity Scheduler calculates a queue's absolute GC value by getting its percent of the total cluster capacity (which is a float, since the configured GC% is a float) and casting it to an int. Casting a float to an int always rounds down. For very small clusters, this can result in the GC of a queue being one lower than what it should be. For example, if Q1 has a GC of 50%, Q2 has a GC of 40%, and Q3 has a GC of 10%, and if the cluster capacity is 4 (as we have, in our test cases), Q1's GC works out to 2, Q2's to 1, and Q3's to 0 with today's code. Q2's capacity should really be 2, as 40% of 4, rounded up, should be 2. > Simple fix is to use Math.round() rather than cast to an int. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.