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

non-transactional user and schema-related activity More...

#include <Operation.h>

Collaboration diagram for Operation:

Public Member Functions

 Operation (int typearg, class TransactionAgent *taarg, int64_t uid, int64_t did)
 
virtual ~Operation ()
 
void setbuiltincmd (int cmd)
 "builtin" is the operation function to perform More...
 
void setDomainName (string name)
 set domain name More...
 
int64_t getid ()
 get operation identifier More...
 
void handleOperation (class MessageUserSchema &msgrcvref)
 perform operation (only for SQL logins) More...
 

Public Attributes

int type
 
class TransactionAgenttaPtr
 
int64_t operationid
 
int sockfd
 
int64_t userid
 
int64_t domainid
 
string domainName
 
schemastruct schemaData
 

Friends

class TransactionAgent
 

Detailed Description

non-transactional user and schema-related activity

Parameters
typeargtype of operation
taargTransactionAgent
uiduserid
diddomainid

Definition at line 60 of file Operation.h.

Constructor & Destructor Documentation

Operation::Operation ( int  typearg,
class TransactionAgent taarg,
int64_t  uid,
int64_t  did 
)

Definition at line 33 of file Operation.cc.

References schemastruct::msgwaits, nodeTopology, Topology::numengines, Topology::numtransactionagents, OP_SCHEMA, operationid, TransactionAgent::operationidcounter, TransactionAgent::pendingOperations, schemaData, sockfd, TransactionAgent::sockfd, taPtr, and type.

34  : type(typearg), taPtr(taarg), userid(uid),
35  domainid(did)
36 {
37  class TransactionAgent &taRef = *taPtr;
39  taRef.pendingOperations[operationid] = this;
40  sockfd = taRef.sockfd;
41 
42  if (type==OP_SCHEMA)
43  {
45  __sync_add_and_fetch(&nodeTopology.numtransactionagents, 0) +
46  __sync_add_and_fetch(&nodeTopology.numengines, 0);
47  }
48 }
Operation::~Operation ( )
virtual

Definition at line 50 of file Operation.cc.

51 {
52 }

Member Function Documentation

int64_t Operation::getid ( )

get operation identifier

Returns
operation identifier

Definition at line 54 of file Operation.cc.

References operationid.

Referenced by TransactionAgent::changepassword(), TransactionAgent::createdomain(), TransactionAgent::createuser(), TransactionAgent::deletedomain(), TransactionAgent::deleteuser(), TransactionAgent::login(), and TransactionAgent::schemaBoilerplate().

55 {
56  return operationid;
57 }

Here is the caller graph for this function:

void Operation::handleOperation ( class MessageUserSchema msgrcvref)

perform operation (only for SQL logins)

Parameters
msgrcvrefreceived MessageUserSchema

Definition at line 69 of file Operation.cc.

References MessageUserSchema::userschema_s::caller, MessageUserSchema::userschema_s::callerstate, Pg::continueLogin(), operationid, TransactionAgent::pendingOperations, TransactionAgent::Pgs, sockfd, taPtr, type, and MessageUserSchema::userschemaStruct.

Referenced by TransactionAgent::TransactionAgent().

70 {
71  switch (msgrcvref.userschemaStruct.caller)
72  {
73  case 1: // Pg login
74  {
75  boost::unordered_map<int, class Pg *>::iterator it;
76  it = taPtr->Pgs.find(sockfd);
77 
78  if (it != taPtr->Pgs.end())
79  {
80  class Pg &pgref = *it->second;
81  pgref.continueLogin(msgrcvref.userschemaStruct.callerstate, msgrcvref);
83  delete this;
84  }
85  else
86  {
87  printf("%s %i anomaly Pg object not in Pgs, sockfd %i\n", __FILE__,
88  __LINE__, sockfd);
89  }
90  }
91  break;
92 
93  default:
94  printf("%s %i anomaly type %i\n", __FILE__, __LINE__, type);
95  }
96 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Operation::setbuiltincmd ( int  cmd)

"builtin" is the operation function to perform

Parameters
cmdcommand, one of BUILTIN* macros defined in defs.h

Definition at line 59 of file Operation.cc.

References schemastruct::builtincmd, and schemaData.

Referenced by TransactionAgent::schemaBoilerplate().

60 {
61  schemaData.builtincmd = cmd;
62 }

Here is the caller graph for this function:

void Operation::setDomainName ( string  name)

set domain name

Parameters
namedomain name

Definition at line 64 of file Operation.cc.

References domainName.

Referenced by TransactionAgent::login().

65 {
66  domainName = name;
67 }

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class TransactionAgent
friend

Definition at line 67 of file Operation.h.

Member Data Documentation

int64_t Operation::domainid

Definition at line 101 of file Operation.h.

string Operation::domainName

Definition at line 102 of file Operation.h.

Referenced by TransactionAgent::login(), and setDomainName().

int64_t Operation::operationid

Definition at line 98 of file Operation.h.

Referenced by Pg::cont(), getid(), handleOperation(), and Operation().

int Operation::sockfd

Definition at line 99 of file Operation.h.

Referenced by Pg::cont(), handleOperation(), and Operation().

class TransactionAgent* Operation::taPtr

Definition at line 97 of file Operation.h.

Referenced by handleOperation(), and Operation().

int Operation::type

Definition at line 96 of file Operation.h.

Referenced by handleOperation(), and Operation().

int64_t Operation::userid

Definition at line 100 of file Operation.h.


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