You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by "Aaron.Dossett" <Aa...@target.com> on 2015/10/30 02:54:14 UTC

[HDFS] Programatic way to determine is a file is under construction?

Hi,

I'm looking for a programatic way to determine if an HDFS file is open for writing (or under construction).  `hadoop fsck` has options to show files that are open, but looking through the HDFS source code none of the methods and classes used to determine if a file is open are part of the public HDFS interface (for example FSDirectory has method to retrieve an INodeFile for a given path, which can tell you if a file is under construction - but there is no way to instantiate an FDDirectory object outside of the HDFS package).

In a perfect world, a public method like FileStatus.isUnderConstruction() would exist... are there any alternatives?

Thanks in advance for any advice! -Aaron