I test using FileSystem (obtained through FileSystem.get(conf)) to
list files (fs.listStatus(path)) within a dir (e.g. dir_), but the
returned FileStatus array is null.

This folder is created by a MapFile object, writing key, value data to hdfs.

       MapFile.Writer output = new MapFile.Writer(conf, fs,
"path/to/dir_", Text.class, CustomizedWritableData.class);

The strange part is the listStatus function (inside the program)
returns null value only for the path created by MapFile, other path
does not have such issue (e.g. listStatus(path/to/other_folder)
returns files withing that folder).

check if path/to/dir exists? true // dir is a folder exists under the
same parent as dir_
check if path/to/dir_ exists? false
check if path/to/dir_/data file exists?? false

However, list using hadoop fs -ls path/to/dir_ shows

-rw-r--r--   3 abc supergroup     142045 2011-10-15 17:32
/user/abc/path/to/dir_/data
-rw-r--r--   3 abc supergroup        645 2011-10-15 17:32
/user/abc/path/to/dir_/index

Envrionment: hadoop 0.20.2

Is there any reason that can account for this?

Reply via email to