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.
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.