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

Switch to Threaded View
HDFS >> mail # user >> atime for a directory


Copy link to this message
-
Re: atime for a directory
Yes HDFS supports aTime only for files. Support for directories would be too
expensive.
Thanks,
--Konstantin

On Thu, Nov 11, 2010 at 12:44 AM, Vivekanand Vellanki <[EMAIL PROTECTED]>wrote:

> Hi,
>
> I was looking at the test cases for HDFS and found the following test
> - org.apache.hadoop.hdfs.TestSetTimes.testTimes
>
> From the below, it appears that getAccessTime() for a directory should
> return 0. Is this true?
>
>       System.out.println("Creating testdir1 and testdir1/test1.dat.");
>       Path dir1 = new Path("testdir1");
>       Path file1 = new Path(dir1, "test1.dat");
>       FSDataOutputStream stm = writeFile(fileSys, file1, replicas);
>       FileStatus stat = fileSys.getFileStatus(file1);
>       long atimeBeforeClose = stat.getAccessTime();
>       String adate = dateForm.format(new Date(atimeBeforeClose));
>       System.out.println("atime on " + file1 + " before close is " +
>                          adate + " (" + atimeBeforeClose + ")");
>       assertTrue(atimeBeforeClose != 0);
>       stm.close();
>
> <snip>
>
>       //
>       // record dir times
>       //
>       stat = fileSys.getFileStatus(dir1);
>       long mdir1 = stat.getAccessTime();
>       assertTrue(mdir1 == 0);
>
> thanks
> Vivek
>
>
>