> an we also enhance DFSClient.getFileInfo() to return the current length of a file (for a file that is being written into)...
I think it may be a good idea to change DFSClient.getFileInfo(). But we cannot easily update stat.length since there is no api to update the length in FileStatus.
> The benefit of this approach might reduce confusion to users...especially if DFSClient.getFileInfo() and DfsClient.getFileLength() returns different file sizes for the same file. Also, I am guessing that this will not introduce any new performance impact.
There is no such method called DfsClient.getFileLength(). Do you mean DfsClient.DFSInputStream.getFileLength()? This method is not visible since DfsClient.DFSInputStream is package private (and I change it to private in my patch).
For the performance, it is hard to estimate since there are two additional round trips (one to the NN and one to a DN) for DFSClient.open(..).