Apache Mesos
Public Member Functions | List of all members
mesos::internal::recordio::Reader< T > Class Template Reference

Provides RecordIO decoding on top of an http::Pipe::Reader. More...

#include <recordio.hpp>

Public Member Functions

 Reader (::recordio::Decoder< T > &&decoder, process::http::Pipe::Reader reader)
 
virtual ~Reader ()
 
process::Future< Result< T > > read ()
 Returns the next piece of decoded data from the pipe. More...
 

Detailed Description

template<typename T>
class mesos::internal::recordio::Reader< T >

Provides RecordIO decoding on top of an http::Pipe::Reader.

The caller is responsible for closing the http::Pipe::Reader when a failure is encountered or end-of-file is reached.

TODO(bmahler): Since we currently do not have a generalized abstraction in libprocess for "streams" of asynchronous data (e.g. process::Stream<T>), we have to create a one-off wrapper here. In the future, this would be better expressed as "piping" data from a stream of raw bytes into a decoder, which yields a stream of typed data.

Constructor & Destructor Documentation

template<typename T >
mesos::internal::recordio::Reader< T >::Reader ( ::recordio::Decoder< T > &&  decoder,
process::http::Pipe::Reader< T >  reader 
)
inline
template<typename T >
virtual mesos::internal::recordio::Reader< T >::~Reader ( )
inlinevirtual

Member Function Documentation

template<typename T >
process::Future<Result<T> > mesos::internal::recordio::Reader< T >::read ( )
inline

Returns the next piece of decoded data from the pipe.

Returns error if an individual record could not be decoded. Returns none when end-of-file is reached. Returns failure when the pipe or decoder has failed.


The documentation for this class was generated from the following file: