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 0E02018D1B for ; Wed, 23 Sep 2015 16:04:11 +0000 (UTC) Received: (qmail 41502 invoked by uid 500); 23 Sep 2015 16:04:04 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 41460 invoked by uid 500); 23 Sep 2015 16:04:04 -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 41447 invoked by uid 99); 23 Sep 2015 16:04:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 16:04:04 +0000 Date: Wed, 23 Sep 2015 16:04:04 +0000 (UTC) From: "zhihai xu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-4095) Avoid sharing AllocatorPerContext object in LocalDirAllocator between ShuffleHandler and LocalDirsHandlerService. 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-4095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14904722#comment-14904722 ] zhihai xu commented on YARN-4095: --------------------------------- Thanks [~jlowe] for reviewing and committing the patch! > Avoid sharing AllocatorPerContext object in LocalDirAllocator between ShuffleHandler and LocalDirsHandlerService. > ----------------------------------------------------------------------------------------------------------------- > > Key: YARN-4095 > URL: https://issues.apache.org/jira/browse/YARN-4095 > Project: Hadoop YARN > Issue Type: Improvement > Components: nodemanager > Reporter: zhihai xu > Assignee: zhihai xu > Fix For: 2.8.0 > > Attachments: YARN-4095.000.patch, YARN-4095.001.patch > > > Currently {{ShuffleHandler}} and {{LocalDirsHandlerService}} share {{AllocatorPerContext}} object in {{LocalDirAllocator}} for configuration {{NM_LOCAL_DIRS}} because {{AllocatorPerContext}} are stored in a static TreeMap with configuration name as key > {code} > private static Map contexts = > new TreeMap(); > {code} > {{LocalDirsHandlerService}} and {{ShuffleHandler}} both create a {{LocalDirAllocator}} using {{NM_LOCAL_DIRS}}. Even they don't use the same {{Configuration}} object, but they will use the same {{AllocatorPerContext}} object. Also {{LocalDirsHandlerService}} may change {{NM_LOCAL_DIRS}} value in its {{Configuration}} object to exclude full and bad local dirs, {{ShuffleHandler}} always uses the original {{NM_LOCAL_DIRS}} value in its {{Configuration}} object. So every time {{AllocatorPerContext#confChanged}} is called by {{ShuffleHandler}} after {{LocalDirsHandlerService}}, {{AllocatorPerContext}} need be reinitialized because {{NM_LOCAL_DIRS}} value is changed. This will cause some overhead. > {code} > String newLocalDirs = conf.get(contextCfgItemName); > if (!newLocalDirs.equals(savedLocalDirs)) { > {code} > So it will be a good improvement to not share the same {{AllocatorPerContext}} instance between {{ShuffleHandler}} and {{LocalDirsHandlerService}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)