Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97D2B10240 for ; Mon, 3 Jun 2013 20:06:20 +0000 (UTC) Received: (qmail 93342 invoked by uid 500); 3 Jun 2013 20:06:20 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 93310 invoked by uid 500); 3 Jun 2013 20:06:20 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 93301 invoked by uid 99); 3 Jun 2013 20:06:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 20:06:20 +0000 Date: Mon, 3 Jun 2013 20:06:20 +0000 (UTC) From: "Bikas Saha (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-750) Allow for black-listing resources in CS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13673496#comment-13673496 ] Bikas Saha commented on YARN-750: --------------------------------- Probably dont need the iterator {code} + private void addBlacklistAdditionsToProto() { + maybeInitBuilder(); + builder.clearBlacklistAdditions(); + if (blacklistAdditions == null) { + return; + } + Iterable iterable = new Iterable() { + @Override + public Iterator iterator() { + return new Iterator() { + + Iterator iter = blacklistAdditions.iterator(); + + @Override + public boolean hasNext() { + return iter.hasNext(); + } + + @Override + public String next() { + return iter.next(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + + } + }; + + } + }; {code} The null should probably clear the internal list also. {code} + @Override + public void setBlacklistAdditions(List resourceNames) { + if (blacklistAdditions == null) { + return; + } + initBlacklistAdditions(); + this.blacklistAdditions.clear(); + if (resourceNames != null) { + this.blacklistAdditions.addAll(resourceNames); + } + } {code} Please check with [~sseth]. build() is probably required for immutable records. {code} + @Override + protected void build() { + proto = builder.build(); + builder = null; + } +} {code} Looks like the javadoc has gotten mixed up {code} +/** + * The exception is thrown when the requested resource is out of the range + * of the configured lower and upper resource boundaries. + * + */ +public class InvalidBlacklistRequestException extends YarnException { ..... /** - * The exception is thrown when the requested resource is out of the range - * of the configured lower and upper resource boundaries. - * + * The exception is thrown when an application tries to blacklist + * {@link ResourceRequest#ANY}. */ public class InvalidResourceRequestException extends YarnException { {code} This and a couple of others like this should probably not be null. {code} // Update application requests - application.updateResourceRequests(ask); + application.updateResourceRequests(ask, null); {code} Changes for Fair Scheduler? > Allow for black-listing resources in CS > --------------------------------------- > > Key: YARN-750 > URL: https://issues.apache.org/jira/browse/YARN-750 > Project: Hadoop YARN > Issue Type: Sub-task > Reporter: Arun C Murthy > Assignee: Arun C Murthy > Attachments: YARN-750.patch > > > YARN-392 and YARN-398 enhance scheduler api to allow for white-lists of resources. > This jira is a companion to allow for black-listing (in CS). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira