InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MessageDispatch Class Reference

Message variant for synchronous replication. More...

#include <Message.h>

Inheritance diagram for MessageDispatch:
Collaboration diagram for MessageDispatch:

Classes

struct  dispatch_s
 MessageDispatch POD (serializable by memcpy) data members. More...
 
struct  record_s
 

Public Member Functions

 MessageDispatch ()
 
virtual ~MessageDispatch ()
 
size_t size ()
 get Message size More...
 
string * ser ()
 create string with serialized message More...
 
void package (class SerializedMessage &serobj)
 serialize this More...
 
void unpack (SerializedMessage &serobj)
 deserialize into this More...
 
void clear ()
 clear contents of this More...
 
- Public Member Functions inherited from Message
 Message ()
 
virtual ~Message ()
 
size_t size ()
 get Message size More...
 
std::string * ser ()
 create string with serialized message More...
 
void package (class SerializedMessage &serobj)
 serialize this More...
 
void unpack (SerializedMessage &serobj)
 deserialize into this More...
 
void clear ()
 clear contents of this More...
 
string * sermsg ()
 return serialized Message variant string More...
 
void setEnvelope (const Topology::addressStruct &source, const Topology::addressStruct &dest, class Message &msg)
 put addresses in Message variant envelope More...
 

Public Attributes

dispatch_s dispatchStruct
 
boost::unordered_map< int64_t,
int64_t > 
pidsids
 
boost::unordered_map< int64_t,
std::vector< record_s > > 
records
 
- Public Attributes inherited from Message
__int128 nextmsg
 
message_s messageStruct
 

Additional Inherited Members

- Static Public Member Functions inherited from Message
static class Messagedes (string *serstr)
 deserialize entire message More...
 

Detailed Description

Message variant for synchronous replication.

Returns

Definition at line 552 of file Message.h.

Constructor & Destructor Documentation

MessageDispatch::MessageDispatch ( )
MessageDispatch::~MessageDispatch ( )
virtual

Definition at line 551 of file Message.cc.

552 {
553 }

Member Function Documentation

void MessageDispatch::clear ( )

clear contents of this

Definition at line 590 of file Message.cc.

References Message::clear(), dispatchStruct, pidsids, and records.

591 {
592  Message::clear();
593  dispatchStruct={};
594  pidsids.clear();
595  records.clear();
596 }

Here is the call graph for this function:

void MessageDispatch::package ( class SerializedMessage serobj)

serialize this

Parameters
serobjSerializedMessage

Definition at line 574 of file Message.cc.

References dispatchStruct, Message::package(), pidsids, records, and SerializedMessage::ser().

Referenced by ser().

575 {
576  Message::package(serobj);
577  serobj.ser(dispatchStruct);
578  serobj.ser(pidsids);
579  serobj.ser(records);
580 }

Here is the call graph for this function:

Here is the caller graph for this function:

string * MessageDispatch::ser ( )

create string with serialized message

Returns
serialized message string

Definition at line 562 of file Message.cc.

References SerializedMessage::data, SerializedMessage::getpayloadtype(), logfile, package(), and SerializedMessage::pos.

563 {
564  class SerializedMessage serobj(size());
565  package(serobj);
566  if (serobj.data->size() != serobj.pos)
567  {
568  fprintf(logfile, "%s %i ser %i size %lu pos %lu\n", __FILE__, __LINE__,
569  serobj.getpayloadtype(), serobj.data->size(), serobj.pos);
570  }
571  return serobj.data;
572 }

Here is the call graph for this function:

size_t MessageDispatch::size ( )

get Message size

Returns
size in bytes

Definition at line 555 of file Message.cc.

References dispatchStruct, pidsids, records, SerializedMessage::sersize(), and Message::size().

Here is the call graph for this function:

void MessageDispatch::unpack ( SerializedMessage serobj)

deserialize into this

Parameters
serobjSerializedMessage

Definition at line 582 of file Message.cc.

References SerializedMessage::des(), dispatchStruct, pidsids, records, and Message::unpack().

Referenced by Message::des().

583 {
584  Message::unpack(serobj);
585  serobj.des(dispatchStruct);
586  serobj.des(pidsids);
587  serobj.des(records);
588 }

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

dispatch_s MessageDispatch::dispatchStruct
boost::unordered_map<int64_t, int64_t> MessageDispatch::pidsids

Definition at line 611 of file Message.h.

Referenced by clear(), Transaction::makeMessageDispatch(), package(), size(), and unpack().

boost::unordered_map< int64_t, std::vector<record_s> > MessageDispatch::records

Definition at line 613 of file Message.h.

Referenced by clear(), Transaction::makeMessageDispatch(), package(), size(), and unpack().


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