Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <thrift-util.h>
Public Member Functions | |
ThriftSerializer (bool compact, int initial_buffer_size=1024) | |
template<class T > | |
Status | Serialize (T *obj, std::vector< uint8_t > *result) |
Serializes obj into result. Result will contain a copy of the memory. More... | |
template<class T > | |
Status | Serialize (T *obj, uint32_t *len, uint8_t **buffer) |
template<class T > | |
Status | Serialize (T *obj, std::string *result) |
Private Attributes | |
boost::shared_ptr < apache::thrift::transport::TMemoryBuffer > | mem_buffer_ |
boost::shared_ptr < apache::thrift::protocol::TProtocol > | protocol_ |
Utility class to serialize thrift objects to a binary format. This object should be reused if possible to reuse the underlying memory. Note: thrift will encode NULLs into the serialized buffer so it is not valid to treat it as a string.
Definition at line 39 of file thrift-util.h.
impala::ThriftSerializer::ThriftSerializer | ( | bool | compact, |
int | initial_buffer_size = 1024 |
||
) |
If compact, the objects will be serialized using the Compact Protocol. Otherwise, we'll use the binary protocol. Note: the deserializer must be matching.
Definition at line 66 of file thrift-util.cc.
References mem_buffer_, and protocol_.
|
inline |
Serializes obj into result. Result will contain a copy of the memory.
Definition at line 48 of file thrift-util.h.
References impala::Status::OK, and RETURN_IF_ERROR.
Referenced by impala::AdmissionController::AddPoolUpdates(), impala::CatalogServer::BuildTopicUpdates(), main(), impala::SerializeThriftMsg(), and impala::TEST().
|
inline |
Serialize obj into a memory buffer. The result is returned in buffer/len. The memory returned is owned by this object and will be invalid when another object is serialized.
Definition at line 61 of file thrift-util.h.
References mem_buffer_, impala::Status::OK, and protocol_.
|
inline |
Definition at line 75 of file thrift-util.h.
References mem_buffer_, impala::Status::OK, and protocol_.
|
private |
Definition at line 89 of file thrift-util.h.
Referenced by Serialize(), and ThriftSerializer().
|
private |
Definition at line 90 of file thrift-util.h.
Referenced by Serialize(), and ThriftSerializer().