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

Actor which communicates with clients and executes transactions. Coordinates of activities between several other actors. More...

#include "gch.h"
#include "Operation.h"
#include "Table.h"
#include "Schema.h"
#include "Larxer.h"
#include "Transaction.h"
#include "Applier.h"
Include dependency graph for TransactionAgent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  idl
 orphan More...
 
struct  responseData
 for storing network responses held up by EAGAIN on raw interface More...
 
struct  authInfo
 authentication information, uniquely identifying a user More...
 
class  TransactionAgent
 execute Transaction Agent actor More...
 

Typedefs

typedef vector< idlcmds
 
typedef boost::unordered_map
< std::string, procedures_s
domainProceduresMap
 
typedef boost::unordered_map
< int, responseData
sendLaterMap
 
typedef std::map< int, authInfosocketAuthInfo
 
typedef boost::unordered_map
< int64_t, class Operation * > 
operationMap
 
typedef ApiInterface *(* spclasscreate )(class TransactionAgent *, class ApiInterface *, void *)
 
typedef void(* spclassdestroy )(ApiInterface *)
 

Enumerations

enum  transactionpayload_e { NOPAYLOAD = 0, SUBTRANSACTIONCMDPAYLOAD, COMMITROLLBACKPAYLOAD }
 type of MessageTransaction variant. likely an orphan More...
 
enum  idlcmd_e {
  IDLNOCMD = 0, IDLROWLOCK, IDLINDEXLOCK, IDLINSERTROW,
  IDLINDEX, IDLDELETEUNIQUEINDEX, IDLINSERTNONUNIQUEINDEX, IDLINSERTNULLINDEX,
  IDLDELETENONUNIQUEINDEX, IDLDELETENULLINDEX, IDLREPLACEINDEX, IDLROLLBACKROW,
  IDLROLLBACKINDEX
}
 likely an orphan More...
 

Functions

msgpack::sbuffer * makeSbuf (msgpack::sbuffer *)
 
msgpack::sbuffer * makeSbuf (vector< string > *)
 
msgpack::sbuffer * makeSbuf (std::map< string, string > *)
 
template<typename T >
void replyTa (T servent, topic_e result, void *msg)
 orphan More...
 
void * transactionAgent (void *identity)
 launch Transaction Agent actor More...
 

Detailed Description

Actor which communicates with clients and executes transactions. Coordinates of activities between several other actors.

Author
Mark Travis mtrav.nosp@m.is15.nosp@m.432+s.nosp@m.rc@g.nosp@m.mail..nosp@m.com
Date
Tue Dec 17 14:03:09 2013

Definition in file TransactionAgent.h.

Typedef Documentation

typedef vector<idl> cmds

Definition at line 94 of file TransactionAgent.h.

typedef boost::unordered_map<std::string, procedures_s> domainProceduresMap

Definition at line 99 of file TransactionAgent.h.

typedef boost::unordered_map<int64_t, class Operation *> operationMap

Definition at line 129 of file TransactionAgent.h.

typedef boost::unordered_map<int, responseData> sendLaterMap

Definition at line 123 of file TransactionAgent.h.

typedef std::map<int, authInfo> socketAuthInfo

Definition at line 128 of file TransactionAgent.h.

typedef ApiInterface*(* spclasscreate)(class TransactionAgent *, class ApiInterface *, void *)

Definition at line 506 of file TransactionAgent.h.

typedef void(* spclassdestroy)(ApiInterface *)

Definition at line 508 of file TransactionAgent.h.

Enumeration Type Documentation

enum idlcmd_e

likely an orphan

Enumerator
IDLNOCMD 
IDLROWLOCK 
IDLINDEXLOCK 
IDLINSERTROW 
IDLINDEX 
IDLDELETEUNIQUEINDEX 
IDLINSERTNONUNIQUEINDEX 
IDLINSERTNULLINDEX 
IDLDELETENONUNIQUEINDEX 
IDLDELETENULLINDEX 
IDLREPLACEINDEX 
IDLROLLBACKROW 
IDLROLLBACKINDEX 

Definition at line 55 of file TransactionAgent.h.

type of MessageTransaction variant. likely an orphan

Returns
Enumerator
NOPAYLOAD 
SUBTRANSACTIONCMDPAYLOAD 
COMMITROLLBACKPAYLOAD 

Definition at line 44 of file TransactionAgent.h.

45 {
46  NOPAYLOAD = 0,
49 };

Function Documentation

msgpack::sbuffer* makeSbuf ( msgpack::sbuffer *  )

Definition at line 1344 of file TransactionAgent.cc.

Referenced by TransactionAgent::sendResponse().

1345 {
1346  return sbuf;
1347 }

Here is the caller graph for this function:

msgpack::sbuffer* makeSbuf ( vector< string > *  )

Definition at line 1349 of file TransactionAgent.cc.

1350 {
1351  msgpack::sbuffer *sbuf = new msgpack::sbuffer;
1352  msgpack::pack(*sbuf, *v);
1353  return sbuf;
1354 }
msgpack::sbuffer* makeSbuf ( std::map< string, string > *  )

Definition at line 1356 of file TransactionAgent.cc.

1357 {
1358  msgpack::sbuffer *sbuf = new msgpack::sbuffer;
1359  msgpack::pack(*sbuf, *m);
1360  return sbuf;
1361 }
template<typename T >
void replyTa ( servent,
topic_e  result,
void *  msg 
)

orphan

Parameters
servent
result
msg

Definition at line 518 of file TransactionAgent.h.

References MessageUserSchema::userschema_s::domainid, Message::messageStruct, MessageUserSchema::userschema_s::operationid, PAYLOADUSERSCHEMA, MessageUserSchema::userschema_s::status, Message::message_s::topic, MessageUserSchema::userschema_s::userid, and MessageUserSchema::userschemaStruct.

519 {
520  class MessageUserSchema &msgref = *(class MessageUserSchema *)msg;
521  servent->msgsnd.data = (void *)msg;
522  ((class Message *)servent->msgsnd.data)->messageStruct.topic = result;
523  ((class Message *)servent->msgsnd.data)->messageStruct.payloadtype =
525  msgref.userschemaStruct.operationid = servent->operationid;
526  msgref.userschemaStruct.domainid = servent->domainid;
527  msgref.userschemaStruct.userid = servent->userid;
528  msgref.userschemaStruct.status = servent->status;
529 }
void* transactionAgent ( void *  identity)

launch Transaction Agent actor

Parameters
identityhow to identify actor instance
Returns

Definition at line 633 of file TransactionAgent.cc.

634 {
636  return NULL;
637 }