Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 358B4200B77 for ; Fri, 19 Aug 2016 19:55:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 343E2160AAB; Fri, 19 Aug 2016 17:55:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7B14D160ABD for ; Fri, 19 Aug 2016 19:55:25 +0200 (CEST) Received: (qmail 59423 invoked by uid 500); 19 Aug 2016 17:55:24 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 59350 invoked by uid 99); 19 Aug 2016 17:55:24 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2016 17:55:24 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6B93A2C015A for ; Fri, 19 Aug 2016 17:55:23 +0000 (UTC) Date: Fri, 19 Aug 2016 17:55:23 +0000 (UTC) From: "Steve Loughran (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-13427) Eliminate needless uses of FileSystem.exists, isFile, isDirectory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 19 Aug 2016 17:55:26 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Loughran updated HADOOP-13427: ------------------------------------ Attachment: HADOOP-13427-001.patch Patch 001 -replace exists calls with getFileStatus -remove exists checks before delete, rename when not needed -remove exists checks before mkdirs There's a few places which raise IO exceptions on nonexistence where getFileStatus() raises the FNFE exception anyway; I've retained those by having them generate the existing exception & text, but now with the inner exception included. We could just get rid of the wrapping entirely for cleaner code. > Eliminate needless uses of FileSystem.exists, isFile, isDirectory > ------------------------------------------------------------------ > > Key: HADOOP-13427 > URL: https://issues.apache.org/jira/browse/HADOOP-13427 > Project: Hadoop Common > Issue Type: Improvement > Components: fs > Affects Versions: 2.8.0 > Reporter: Steve Loughran > Attachments: HADOOP-13427-001.patch > > > We're cleaning up Hive and Spark's use of FileSystem.exists, because it is often the case we see code of exists+open, exists+delete, when the exists probe is needless. Against object stores, expensive needless. > Hadoop can set an example here by stripping them out. It will also show where there are opportunities to optimise things better and/or improve reporting. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org