Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 84352 invoked from network); 27 Mar 2009 19:49:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Mar 2009 19:49:28 -0000 Received: (qmail 27933 invoked by uid 500); 27 Mar 2009 19:49:28 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 27887 invoked by uid 500); 27 Mar 2009 19:49:28 -0000 Mailing-List: contact core-commits-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-commits@hadoop.apache.org Received: (qmail 27878 invoked by uid 99); 27 Mar 2009 19:49:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Mar 2009 19:49:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Mar 2009 19:49:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AC4F92388995; Fri, 27 Mar 2009 19:49:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r759319 - in /hadoop/core/branches/branch-0.20: CHANGES.txt src/core/org/apache/hadoop/fs/FileSystem.java Date: Fri, 27 Mar 2009 19:49:07 -0000 To: core-commits@hadoop.apache.org From: szetszwo@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090327194907.AC4F92388995@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: szetszwo Date: Fri Mar 27 19:49:07 2009 New Revision: 759319 URL: http://svn.apache.org/viewvc?rev=759319&view=rev Log: HADOOP-5588. Remove an unnecessary call to listStatus(..) in FileSystem.globStatusInternal(..). (Hairong Kuang via szetszwo) Modified: hadoop/core/branches/branch-0.20/CHANGES.txt hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/fs/FileSystem.java Modified: hadoop/core/branches/branch-0.20/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=759319&r1=759318&r2=759319&view=diff ============================================================================== --- hadoop/core/branches/branch-0.20/CHANGES.txt (original) +++ hadoop/core/branches/branch-0.20/CHANGES.txt Fri Mar 27 19:49:07 2009 @@ -814,6 +814,9 @@ HADOOP-5571. Remove widening primitive conversion in TupleWritable mask manipulation. (Jingkei Ly via cdouglas) + HADOOP-5588. Remove an unnecessary call to listStatus(..) in + FileSystem.globStatusInternal(..). (Hairong Kuang via szetszwo) + Release 0.19.2 - Unreleased BUG FIXES Modified: hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/fs/FileSystem.java URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/fs/FileSystem.java?rev=759319&r1=759318&r2=759319&view=diff ============================================================================== --- hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/fs/FileSystem.java (original) +++ hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/fs/FileSystem.java Fri Mar 27 19:49:07 2009 @@ -894,9 +894,23 @@ } else { // Now work on the last component of the path GlobFilter fp = new GlobFilter(components[components.length - 1], filter); - results = listStatus(parentPaths, fp); if (fp.hasPattern()) { // last component has a pattern + // list parent directories and then glob the results + results = listStatus(parentPaths, fp); hasGlob[0] = true; + } else { // last component does not have a pattern + // get all the path names + ArrayList filteredPaths = new ArrayList(parentPaths.length); + for (int i = 0; i < parentPaths.length; i++) { + parentPaths[i] = new Path(parentPaths[i], + components[components.length - 1]); + if (fp.accept(parentPaths[i])) { + filteredPaths.add(parentPaths[i]); + } + } + // get all their statuses + results = getFileStatus( + filteredPaths.toArray(new Path[filteredPaths.size()])); } }