hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vivekanand Vellanki <ganj...@yahoo.com>
Subject Re: atime for a directory
Date Thu, 11 Nov 2010 12:55:38 GMT
Thanks for the prompt response.



________________________________
From: Konstantin Shvachko <shv.hadoop@gmail.com>
To: hdfs-user@hadoop.apache.org
Sent: Thu, November 11, 2010 2:18:07 PM
Subject: 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 <ganjuga@yahoo.com> 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
>
>
>



      
Mime
View raw message