Re: What is the approved way in 0.20 to get a file size

2011-11-03 Thread Harsh J
Ah, that is a javadoc typo. Has been fixed in HADOOP-6114. On 04-Nov-2011, at 2:22 AM, Steve Lewis wrote: > I read that getLen returns the length in Blocks - and I wrong and does it > return the length in bytes > the code I see in org.apache.hadoop.fs.FileStatus says > > /* >* @return th

Re: What is the approved way in 0.20 to get a file size

2011-11-03 Thread Uma Maheswara Rao G 72686
Yes, it will return in bytes. NN side code where it is summing the bytes for(Block blk : blocks) { bytes += blk.getNumBytes(); } Thanks Uma - Original Message - From: Steve Lewis Date: Friday, November 4, 2011 2:24 am Subject: Re: What is the approved way in 0.20 to get a file

Re: What is the approved way in 0.20 to get a file size

2011-11-03 Thread Steve Lewis
I read that getLen returns the length in Blocks - and I wrong and does it return the length in bytes the code I see in org.apache.hadoop.fs.FileStatus says /* * @return the length of this file, in blocks */ public long getLen() { return length; } On Thu, Nov 3, 2011 at 11:39 AM, H

Re: What is the approved way in 0.20 to get a file size

2011-11-03 Thread Harsh J
You need to use: http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileStatus.html#getLen() via http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getFileStatus(org.apache.hadoop.fs.Path) On Thu, Nov 3, 2011 at 11:59 PM, Steve Lewis wrote:

What is the approved way in 0.20 to get a file size

2011-11-03 Thread Steve Lewis
FileSystem.getLength(Path path) is deprecated getFileStatus(Path path) .getLen(String path) seems to return the path in Blocks whereas I want it in bytes -- Steven M. Lewis PhD 4221 105th Ave NE Kirkland, WA 98033 206-384-1340 (cell) Skype lordjoe_com