hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Tigarev <alexey.tiga...@gmail.com>
Subject Custom InputFormat: LineRecordReader.LineReader reads 0 bytes
Date Tue, 23 Feb 2010 15:32:21 GMT
Hi All!

I am implementing a custom InputFormat.
Its custom RecordReader uses LineRecordReader.LineReader inside.

In some cases its read() method returns 0, i.e. reads 0 bytes. This
happen also in unit test where it reads form a regular file on UNIX
filesystem.
What does it mean and how should I handle it/avoid it?

After examining the sources I can see that zero count of bytes read
comes from the value returned by FSDataInputStream.read().

In which situations can this happen? -1 would mean end of file, 0 can
mean that no data was available (but end of file still not reached) -
I can not understand how this can happen in case of local file.

Please give me advice :)

Regards,
Alexey Tigarev
<tigra@nlp.od.ua> Jabber: tigra@jabber.od.ua Skype: t__gra

Как программисту стать фрилансером и заработать
первую $1000 на oDesk:
http://freelance-start.com/earn-first-1000-on-odesk

Mime
View raw message