I have a reference to the GoogleHadoopFileSystemBase
in my java code, and I’m trying to call setTimes(Path p, long mtime, long atime)
to modify the timestamp of a file. It doesn’t seem to be working though, even though other FileSystem apis work fine. From the console UI, I can only see the "last uploaded" time. Does the google file system only store the upload time, and thus ignore changes to the modification time and access time? I also checked the timestamp using hadoop fs -ls gs://mybucket/
, but that timestamp also shows up as unchanged.
Asked
Active
Viewed 119 times
1

Alvin C
- 47
- 1
- 6
1 Answers
1
This is unfortunately a limitation of Google Cloud Storage (GCS) and the GCS Hadoop connector. Specifically, GCS objects do not have mtime
and atime
which causes the underlying failure. As a workaround right now, HDFS attached to clusters should function normally.

James
- 2,321
- 14
- 30
-
Is this still true? https://cloud.google.com/storage/docs/json_api/v1/objects#resource does show a field called `updated` of type datetime, which seems to contradict the statement that GCS objects don't have an `mtime`. – Alvin C Feb 12 '16 at 22:56
-
This is still true because `updated` is a read only GCS attribute, that's why it can not be used to implement `FileSystem.setTimes(...)` method. – Igor Dvorzhak Aug 17 '19 at 03:38