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 B97C810559 for ; Thu, 8 Jan 2015 00:27:34 +0000 (UTC) Received: (qmail 97154 invoked by uid 500); 8 Jan 2015 00:27:35 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 97120 invoked by uid 500); 8 Jan 2015 00:27:35 -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 97018 invoked by uid 99); 8 Jan 2015 00:27:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2015 00:27:35 +0000 Date: Thu, 8 Jan 2015 00:27:35 +0000 (UTC) From: "Yi Liu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-2996) Refine fs operations in FileSystemRMStateStore and few fixes 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-2996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yi Liu updated YARN-2996: ------------------------- Summary: Refine fs operations in FileSystemRMStateStore and few fixes (was: Refine some fs operations in FileSystemRMStateStore to improve performance) > Refine fs operations in FileSystemRMStateStore and few fixes > ------------------------------------------------------------ > > Key: YARN-2996 > URL: https://issues.apache.org/jira/browse/YARN-2996 > Project: Hadoop YARN > Issue Type: Improvement > Components: resourcemanager > Reporter: Yi Liu > Assignee: Yi Liu > Attachments: YARN-2996.001.patch, YARN-2996.002.patch, YARN-2996.003.patch, YARN-2996.004.patch > > > In {{FileSystemRMStateStore}}, we can refine some fs operations to improve performance: > *1.* There are several places invoke {{fs.exists}}, then {{fs.getFileStatus}}, we can merge them to save one RPC call > {code} > if (fs.exists(versionNodePath)) { > FileStatus status = fs.getFileStatus(versionNodePath); > {code} > *2.* > {code} > protected void updateFile(Path outputPath, byte[] data) throws Exception { > Path newPath = new Path(outputPath.getParent(), outputPath.getName() + ".new"); > // use writeFile to make sure .new file is created atomically > writeFile(newPath, data); > replaceFile(newPath, outputPath); > } > {code} > The {{updateFile}} is not good too, it write file to _output\_file_.tmp, then rename to _output\_file_.new, then rename it to _output\_file_, we can reduce one rename operation. > Also there is one unnecessary import, we can remove it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)