Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 77272 invoked from network); 6 Oct 2008 06:46:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Oct 2008 06:46:37 -0000 Received: (qmail 69877 invoked by uid 500); 6 Oct 2008 06:46:34 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 69657 invoked by uid 500); 6 Oct 2008 06:46:34 -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 69646 invoked by uid 99); 6 Oct 2008 06:46:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 23:46:34 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE 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, 06 Oct 2008 06:45:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 89333234C211 for ; Sun, 5 Oct 2008 23:45:44 -0700 (PDT) Message-ID: <1223205768.1223275544560.JavaMail.jira@brutus> Date: Sun, 5 Oct 2008 23:45:44 -0700 (PDT) From: "Amar Kamat (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Assigned: (HADOOP-4149) JobQueueJobInProgressListener.jobUpdated() might not work as expected In-Reply-To: <789513532.1221057284309.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-4149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Amar Kamat reassigned HADOOP-4149: ---------------------------------- Assignee: Amar Kamat > JobQueueJobInProgressListener.jobUpdated() might not work as expected > --------------------------------------------------------------------- > > Key: HADOOP-4149 > URL: https://issues.apache.org/jira/browse/HADOOP-4149 > Project: Hadoop Core > Issue Type: Bug > Components: mapred > Affects Versions: 0.19.0 > Reporter: Amar Kamat > Assignee: Amar Kamat > Priority: Blocker > Fix For: 0.19.0 > > > {{JobQueueJobInProgressListener}} uses a {{TreeSet}} to store the sorted collection of {{JobInProgress}} objects. The comparator used to sort the JIPs follow the following order > - priority (>=) > - start time (<=) > - job id [jt-identifier, job-index] (<=) > If any JIP object is changed w.r.t priority or start-time, then the TreeSet will be inconsistent. Hence doing a delete might not work. Consider the following > 1) jobs are submitted in the following order > ||number||jobid||priority|| > |1|j1|NORMAL| > |2|j2|LOW| > |3|j3|NORMAL| > 2) The sorted collection will be in the order : {{j1,j3,j2}} > 3) If job3's priority is changed to LOW then the collection wont change but delete will bail out on j1 itself as the comparator will return a -ve number. TreeSet uses the comparator both for sorting and deleting. If i indicates the index in the collection and obj represents the object under consideration, then looks like TreeSet.remove(obj) follows something like : > - continue to search if the compare(i, obj) is -ve > - bail out if the compare(i, obj) is +ve > - delete the obj of compare(i,obj) == 0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.