hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vivekanand Vellanki <ganj...@yahoo.com>
Subject atime for a directory
Date Thu, 11 Nov 2010 08:44:16 GMT
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