Apache Mesos
Classes
recordio Namespace Reference

Provides facilities for "Record-IO" encoding of data. More...

Classes

class  Decoder
 Given a decoding function for individual records, this provides decoding from "Record-IO" data into typed records. More...
 
class  Encoder
 Given an encoding function for individual records, this provides encoding from typed records into "Record-IO" data. More...
 

Detailed Description

Provides facilities for "Record-IO" encoding of data.

"Record-IO" encoding allows one to encode a sequence of variable-length records by prefixing each record with its size in bytes:

5
hello 6
world!

Note that this currently only supports record lengths encoded as base 10 integer values with newlines as a delimiter. This is to provide better language portability portability: parsing a base 10 integer is simple. Most other "Record-IO" implementations use a fixed-size header of 4 bytes to directly encode an unsigned 32 bit length.

TODO(bmahler): Move this to libprocess and support async consumption of data.