hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Piggott <cpigg...@gmail.com>
Subject Confused about splitting
Date Sun, 10 Feb 2013 15:36:24 GMT
I'm a little confused about splitting and readers.

The data in my application is stored in files of google protocol buffers.
 There are multiple protocol buffers per file.  There have been a number of
simple ways to put multiple protobufs in a single file, usually involving
writing some kind of length field before.  We did something a little more
complicated by defining a frame similar to HDLC: frames are enveloped by a
flag, escapes provided so the flag can't occur within the frame; and there
is a 32-bit CRC-like checksum just before the closing flag.

The protobufs are all a type named RitRecord, and we have our own reader
that's something like this:

   public interface RitRecordReader {
      RitRecord getNext();

The data collection appication stores these things in ordinary flat files
(the whole thing is run through a GzipOutputFilter first, so the files are
compressed).  I'm having trouble understanding how to best apply this to
HDFS for map function consumption.  Our data collector writes 1 megabyte
files, but I can combine them for map/reduce performance.  To avoid TOO
much wasted space I was thinking about 16, 32, or 64 MB HDFS blocks (tbd).

What I don't get is this: suppose we have a long file that spans multiple
HDFS blocks.  I think I end up with problems similar to this guy:


where one of my RitRecord objects is half in one HDFS block and half in
another HDFS block.  If the mapper is assigning tasks to nodes along HDFS
blocks then I'm going to end up with a problem.  It's not yet clear to me
how to solve this.  I could make the problem LESS likely with bigger blocks
(like the default 128MB) but even then, the problem doesn't completely go
away (for me, a >128MB file is unlikely but not impossible).


View raw message