Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HDFS >> mail # user >> Change in behavior of public FileStatus[] globStatus(Path pathPattern, PathFilter filter)


Copy link to this message
-
Re: Change in behavior of public FileStatus[] globStatus(Path pathPattern, PathFilter filter)
Yes this is intentional, and an incompatible change, and was done via
https://issues.apache.org/jira/browse/HADOOP-6201 to have better API
behavior.

On Fri, May 18, 2012 at 2:04 PM, Subroto <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was running a simple unit test for verifying the behavior of a/m API.
> The UT is some thing like this:
>
> public void testResolve_SimpleGlob() throws IOException {
>         File folder = _tempFolder.newFolder("folder");
>         File file1 = createFile(folder, "2010/test1");
>         File file2 = createFile(folder, "2011/test1");
>         File file3 = createFile(folder, "2011/test2");
>
> //some java code to assert
> // fileSystem.globStatus(new Path((folder.getAbsolutePath() + "/20*/test1"))
> contains path for file1 and file2
> // fileSystem.globStatus(new Path((folder.getAbsolutePath() + "/20*/test*"))
> contains path for file1, file2 and file3
> // fileSystem.globStatus(new Path((folder.getAbsolutePath() + "/2011/*"))
> contains path for file2 and file3
> // fileSystem.globStatus(new Path((folder.getAbsolutePath() + "/2012/*")) is
> empty
>     }
>
> The fourth assertion use to work fine in cdh3u3 version but, recently while
> running the same test with cdh4b2, I encountered:
> java.io.FileNotFoundException: File
> /var/folders/4w/yr852nyj3dbd1qj4w6qcwtqm0000gn/T/junit406694769891587251/folder/2012
> does not exist
> at
> org.apache.hadoop.fs.RawLocalFileSystem.listStatus(RawLocalFileSystem.java:315)
> at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1249)
> at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1289)
> at
> org.apache.hadoop.fs.ChecksumFileSystem.listStatus(ChecksumFileSystem.java:557)
> at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1249)
> at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1326)
> at org.apache.hadoop.fs.FileSystem.globStatusInternal(FileSystem.java:1456)
> at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:1411)
> at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:1389)
>
> Is this an intentional change made or shall we need to file it as bug and
> fix it…. ?
>
> Cheers,
> Subroto Sanyal

--
Harsh J