Re: FSDataInputStream.read returns -1 with growing file and never continues reading

2012-12-27 Thread Colin McCabe
Also, read() returning -1 is not an error, it's EOF. This is the same as for the regular Java InputStream. best, Colin On Thu, Dec 20, 2012 at 10:32 AM, Christoph Rupp wrote: > Thank you, Harsh. I appreciate it. > > 2012/12/20 Harsh J > >> Hi Christoph, >> >> If you use sync/hflush/hsync, the

Re: FSDataInputStream.read returns -1 with growing file and never continues reading

2012-12-20 Thread Christoph Rupp
Thank you, Harsh. I appreciate it. 2012/12/20 Harsh J > Hi Christoph, > > If you use sync/hflush/hsync, the new length of data is only seen by a > new reader, not an existent reader. The "workaround" you've done > exactly how we've implemented the "fs -tail " utility. See code > for that at > ht

Re: FSDataInputStream.read returns -1 with growing file and never continues reading

2012-12-20 Thread Harsh J
Hi Christoph, If you use sync/hflush/hsync, the new length of data is only seen by a new reader, not an existent reader. The "workaround" you've done exactly how we've implemented the "fs -tail " utility. See code for that at http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/