The ROOT hadoop file system support is readonly as hadoop does not support the seek operation in write mode needed by ROOT. To use hadoop copy ROOT file on it via scp or any other method.
Thanks, Fons, for your reply. Do you foresee any change on this caveat. Reading is, of course, very nice, but having the possibility to write to hadoop would be great. I know we can hack our code (CMS code, you know) to write locally and then copy to hadoop, but that is quite inconvenient some times.
It’s a limitation of HDFS itself. The underlying file system does not support random seeks during write, nor does it support file modification. ROOT requires random seeks in its file format, while the ostream test you did does not.
We run HDFS for our T2: the easiest thing to do is write the output file to local disk, then copy to HDFS. It’s probably a good idea for any distributed file system, as you don’t consume the shared site-wide resource until after the application has successfully completed.
Thanks. I undertand that is the current limitation on HDFS. Sometimes, as you know, Even if it might be better for a big cluster to save data locally and then copy the file, one has to provide extra knowledge to the users (or the tools). I mean, people will need to modify their scripts that work somewhere else to handle this limitation. And I would have to make sure they really cleanup the local space they use (ex. /tmp) which sometimes (WNs behind batch systems) might not be directly accessible to them. Nothing impossible, nothing new… still a bit annoying to me.
One of the possible solutions I was thinking was a “hack” in TFile (or probably somwhere else in the hierarchy) that whenever a ROOT file is open in a hadoop filesystem if fact creates it in /tmp. Then, when the TFile::Close() method is invoked, the file is copied to the original place. Is this reasonable to you, Fons, Brian? Or do you think it is a completely silly idea?
to keep this simplest I would propose to still write to a local file and then use TFile::Cp() or any other file transfer mechanism to upload the file to Hadoop. The same will be the case for our new I/O plugins to Amazon S2 and Google Storage.