hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Astier <fast...@yahoo-inc.com>
Subject Setting HDFS directory time programmatically
Date Wed, 04 Jan 2012 19:08:54 GMT
Hi -

Is it possible to set the access time of a HDFS directory programmatically?

I’m using 0.20.204.0.

I need to do that in unit tests, where my clean up program is going to remove files/dirs whose
access time is too far in the past. I can setTimes on the test files without any problem,
but not on the directories... The directories created automatically when I create the test
fiels have a date (with getAccessTime) of 1969/12/31 16:00 and I can’t control that date,
which makes my unit testing impossible.

By the way, setTimes doesn’t allow to set the date on dirs, but getAccessTime is happy to
return a date, which is inconsistent, IMHO.

Finally, on our production systems, I’m seeing appropriate dates for both files and directories.

Any insight appreciated,

Thanks!

Frank

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message