InfiniSQL
v0.1.2-alpha
Massive Scale Transaction Processing
|
create Subtransaction object More...
#include <SubTransaction.h>
Public Member Functions | |
SubTransaction (Topology::addressStruct &taAddrarg, int64_t transactionidarg, int64_t domainidarg, class Engine *enginePtrarg) | |
virtual | ~SubTransaction () |
Private Member Functions | |
void | processTransactionMessage (class Message *msgrcvarg) |
handle incoming MessageTransaction variant More... | |
void | commitRollbackUnlock (vector< rowOrField_s > *rowOrFields, enginecmd_e cmd) |
commit, rollback, or unlock items More... | |
void | processRowLockQueue (int64_t tableid, int64_t rowid) |
operate on transactions waiting for locked row More... | |
void | drainRowLockQueue (int64_t tableid, int64_t rowid) |
drain queue of transactions waiting for locked row More... | |
void | processIndexLockQueue (int64_t tableid, int64_t fieldid, fieldValue_s *val) |
operate on transactions waiting for locked unique index entry More... | |
void | drainIndexLockQueue (int64_t tableid, int64_t fieldid, fieldValue_s *val) |
drain queue of transactions waiting for locked unique index entry More... | |
int64_t | newrow (int64_t tableid, std::string row) |
create new row More... | |
locktype_e | uniqueIndex (int64_t tableid, int64_t fieldid, int64_t rowid, int64_t engineid, fieldValue_s *val) |
new unique index entry More... | |
int64_t | updaterow (int64_t tableid, int64_t rowid, std::string *row) |
int64_t | deleterow (int64_t tableid, int64_t rowid) |
delete row More... | |
int64_t | deleterow (int64_t tableid, int64_t rowid, int64_t forward_rowid, int64_t forward_engineid) |
delete row part of row replacement (UPDATEing fieldid 0) More... | |
void | indexSearch (int64_t tableid, int64_t fieldid, searchParams_s *searchParameters, vector< nonLockingIndexEntry_s > *indexHits) |
void | selectrows (int64_t tableid, vector< int64_t > *rowids, locktype_e locktype, int64_t pendingcmdid, vector< returnRow_s > *returnRows) |
return rows More... | |
void | searchReturn1 (int64_t tableid, int64_t fieldid, locktype_e locktype, searchParams_s &searchParams, vector< returnRow_s > &returnRows) |
search index for and return matching rows More... | |
void | replyTransaction (void *data) |
reply to calling TransactionAgent More... | |
void | replyTransaction (class MessageTransaction &sndRef, class MessageTransaction &rcvRef) |
reply to calling TransactionAgent More... | |
Private Attributes | |
int64_t | subtransactionid |
Topology::addressStruct | taAddr |
int64_t | transactionid |
int64_t | domainid |
class Message * | msgrcv |
class Engine * | enginePtr |
class Schema * | schemaPtr |
Friends | |
class | Engine |
create Subtransaction object
taAddrarg | address of TransactionAgent associated with Transaction |
transactionidarg | related transactionid |
domainidarg | domainid |
enginePtrarg | Engine (partition) |
Definition at line 47 of file SubTransaction.h.
SubTransaction::SubTransaction | ( | Topology::addressStruct & | taAddrarg, |
int64_t | transactionidarg, | ||
int64_t | domainidarg, | ||
class Engine * | enginePtrarg | ||
) |
Definition at line 33 of file SubTransaction.cc.
References domainid, Engine::domainidsToSchemata, enginePtr, Engine::getnextsubtransactionid(), schemaPtr, subtransactionid, and Engine::SubTransactions.
|
virtual |
Definition at line 44 of file SubTransaction.cc.
References enginePtr, subtransactionid, and Engine::SubTransactions.
|
private |
commit, rollback, or unlock items
rowOrFields | list of rows and unique index entries |
cmd | commit, rollback or unlock |
Definition at line 1722 of file SubTransaction.cc.
References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, COMMITCMD, Index::commitRollback(), Table::commitRollbackUnlock(), rowOrField_s::fieldid, Table::fields, Index::fieldtype, rowOrField_s::fieldVal, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, rowOrField_s::isrow, logfile, rowOrField_s::rowid, schemaPtr, fieldValue_s::str, subtransactionid, rowOrField_s::tableid, Schema::tables, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.
|
private |
delete row
tableid | tableid |
rowid | rowid |
Definition at line 2298 of file SubTransaction.cc.
References Table::deleterow(), schemaPtr, subtransactionid, and Schema::tables.
Referenced by processTransactionMessage().
|
private |
delete row part of row replacement (UPDATEing fieldid 0)
tableid | tableid |
rowid | rowid |
forward_rowid | new rowid |
forward_engineid | new engineid |
Definition at line 2304 of file SubTransaction.cc.
References Table::deleterow(), schemaPtr, subtransactionid, and Schema::tables.
|
private |
drain queue of transactions waiting for locked unique index entry
when index entry cannot be re-locked
tableid | tableid |
fieldid | fieldid |
val | field value |
Definition at line 2171 of file SubTransaction.cc.
References BOOL, fieldInput_u::boolean, Index::boolLockQueue, CHAR, fieldInput_u::character, Index::charLockQueue, CHARX, MessageTransaction::transaction_s::engineinstance, enginePtr, lockQueueIndexEntry::entry, MessageSubtransactionCmd::subtransaction_s::fieldid, Index::fieldtype, MessageSubtransactionCmd::fieldVal, FLOAT, fieldInput_u::floating, Index::floatLockQueue, INT, fieldInput_u::integer, Index::intLockQueue, MessageSubtransactionCmd::subtransaction_s::locktype, logfile, Message::messageStruct, MessageSubtransactionCmd::MessageSubtransactionCmd(), Engine::partitionid, PAYLOADSUBTRANSACTION, Message::message_s::payloadtype, lockQueueIndexEntry::pendingcmdid, PENDINGTOINDEXNOLOCK, replyTransaction(), schemaPtr, fieldValue_s::str, Index::stringLockQueue, lockingIndexEntry::subtransactionid, MessageTransaction::transaction_s::subtransactionid, Engine::SubTransactions, MessageSubtransactionCmd::subtransactionStruct, MessageSubtransactionCmd::subtransaction_s::tableid, Schema::tables, lockQueueIndexEntry::tacmdentrypoint, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transaction_s::transaction_tacmdentrypoint, transactionid, MessageTransaction::transaction_s::transactionid, MessageTransaction::transactionStruct, UINT, fieldInput_u::uinteger, Index::uintLockQueue, fieldValue_s::value, and VARCHAR.
Referenced by processTransactionMessage().
|
private |
drain queue of transactions waiting for locked row
used when row cannot be re-locked, such as when deleted
tableid | tableid |
rowid |
Definition at line 1898 of file SubTransaction.cc.
References MessageTransaction::transaction_s::engineinstance, enginePtr, Table::lockQueue, Message::messageStruct, MessageSubtransactionCmd::MessageSubtransactionCmd(), Engine::partitionid, PAYLOADSUBTRANSACTION, Message::message_s::payloadtype, lockQueueRowEntry::pendingcmdid, PENDINGTONOLOCK, replyTransaction(), MessageSubtransactionCmd::returnRows, schemaPtr, lockQueueRowEntry::subtransactionid, MessageTransaction::transaction_s::subtransactionid, Engine::SubTransactions, Schema::tables, lockQueueRowEntry::tacmdentrypoint, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transaction_s::transaction_tacmdentrypoint, transactionid, MessageTransaction::transaction_s::transactionid, and MessageTransaction::transactionStruct.
Referenced by processTransactionMessage().
|
private |
Definition at line 981 of file SubTransaction.cc.
References Index::between(), BOOL, CHAR, CHARX, Index::comparison(), Index::fieldtype, FLOAT, Index::getall(), Index::getequal(), Index::getin(), Index::getnotequal(), Index::getnotin(), Index::getnotnulls(), Index::getnulls(), INT, Index::like(), logfile, Index::notbetween(), Index::notlike(), searchParams_s::op, OPERATOR_BETWEEN, OPERATOR_EQ, OPERATOR_GT, OPERATOR_GTE, OPERATOR_IN, OPERATOR_ISNOTNULL, OPERATOR_ISNULL, OPERATOR_LIKE, OPERATOR_LT, OPERATOR_LTE, OPERATOR_NE, OPERATOR_NOTBETWEEN, OPERATOR_NOTIN, OPERATOR_NOTLIKE, OPERATOR_REGEX, OPERATOR_SELECTALL, Index::regex(), searchParams_s::regexString, schemaPtr, Schema::tables, UINT, searchParams_s::values, and VARCHAR.
Referenced by processTransactionMessage(), and searchReturn1().
|
private |
create new row
tableid | tableid |
row | row string |
Definition at line 2283 of file SubTransaction.cc.
References Table::getnextrowid(), Table::newrow(), schemaPtr, subtransactionid, and Schema::tables.
Referenced by processTransactionMessage().
|
private |
operate on transactions waiting for locked unique index entry
tableid | tableid |
fieldid | fieldid |
val | field value |
Definition at line 1934 of file SubTransaction.cc.
Referenced by processTransactionMessage().
|
private |
operate on transactions waiting for locked row
tableid | tableid |
rowid | rowid |
Definition at line 1819 of file SubTransaction.cc.
Referenced by processTransactionMessage().
|
private |
handle incoming MessageTransaction variant
msgrcvarg | received MessageTransaction variant |
Definition at line 49 of file SubTransaction.cc.
References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, COMMITCMD, Index::commitRollback(), Table::commitRollbackUnlock(), rowOrField_s::deleteindexentry, Index::deleteNonuniqueEntry(), Index::deleteNullEntry(), deleterow(), DELETEROW, Index::deleteUniqueEntry(), drainIndexLockQueue(), drainRowLockQueue(), rowOrField_s::engineid, MessageSubtransactionCmd::subtransaction_s::engineid, rowOrField_s::fieldid, MessageSubtransactionCmd::subtransaction_s::fieldid, Table::fields, Index::fieldtype, rowOrField_s::fieldVal, MessageSubtransactionCmd::fieldVal, FLOAT, fieldInput_u::floating, MessageSubtransactionCmd::subtransaction_s::forward_engineid, MessageSubtransactionCmd::subtransaction_s::forward_rowid, MessageSubtransactionCmd::indexHits, indexSearch(), INDEXSEARCH, Index::insertNonuniqueEntry(), Index::insertNullEntry(), INT, fieldInput_u::integer, rowOrField_s::isnotaddunique, fieldValue_s::isnull, rowOrField_s::isreplace, rowOrField_s::isrow, Index::isunique, MessageSubtransactionCmd::subtransaction_s::locktype, logfile, Message::messageStruct, msgrcv, rowOrField_s::newengineid, newrow(), NEWROW, rowOrField_s::newrowid, PAYLOADCOMMITROLLBACK, PAYLOADSUBTRANSACTION, Message::message_s::payloadtype, processIndexLockQueue(), processRowLockQueue(), REPLACEDELETEROW, Index::replaceNonunique(), Index::replaceNull(), Index::replaceUnique(), replyTransaction(), MessageSubtransactionCmd::returnRows, REVERTCMD, MessageCommitRollback::rofs, ROLLBACKCMD, MessageSubtransactionCmd::row, rowOrField_s::rowid, MessageSubtransactionCmd::subtransaction_s::rowid, MessageSubtransactionCmd::rowids, Table::rows, schemaPtr, MessageSubtransactionCmd::searchParameters, searchReturn1(), SEARCHRETURN1, selectrows(), SELECTROWS, MessageSubtransactionCmd::subtransaction_s::status, fieldValue_s::str, subtransactionid, MessageSubtransactionCmd::subtransactionStruct, rowOrField_s::tableid, MessageSubtransactionCmd::subtransaction_s::tableid, Schema::tables, MessageTransaction::transaction_s::transaction_enginecmd, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transactionStruct, UINT, fieldInput_u::uinteger, uniqueIndex(), UNIQUEINDEX, updaterow(), UPDATEROW, fieldValue_s::value, VARCHAR, and WRITELOCK.
Referenced by Engine::Engine().
|
private |
reply to calling TransactionAgent
data | Message variant to send |
Definition at line 1779 of file SubTransaction.cc.
References Topology::partitionAddress::address, MessageTransaction::transaction_s::engineinstance, enginePtr, Engine::mboxes, Message::messageStruct, msgrcv, Engine::myIdentity, Engine::partitionid, Message::message_s::payloadtype, subtransactionid, MessageTransaction::transaction_s::subtransactionid, taAddr, Mboxes::toActor(), Message::message_s::topic, TOPIC_TRANSACTION, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transaction_s::transaction_tacmdentrypoint, MessageTransaction::transaction_s::transactionid, and MessageTransaction::transactionStruct.
Referenced by drainIndexLockQueue(), drainRowLockQueue(), and processTransactionMessage().
|
private |
reply to calling TransactionAgent
for draining queue of old transactions. state from old subtransaction is kept in the original received Message variant
Definition at line 1800 of file SubTransaction.cc.
References Topology::partitionAddress::address, MessageTransaction::transaction_s::engineinstance, enginePtr, Engine::mboxes, Message::messageStruct, Engine::myIdentity, Engine::partitionid, Message::message_s::payloadtype, subtransactionid, MessageTransaction::transaction_s::subtransactionid, taAddr, Mboxes::toActor(), Message::message_s::topic, TOPIC_TRANSACTION, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transaction_s::transaction_tacmdentrypoint, MessageTransaction::transaction_s::transactionid, and MessageTransaction::transactionStruct.
|
private |
search index for and return matching rows
rows are distributed across partitions by field 0 hash this function performs index lookup and data return in 1 step for selects against field 0
tableid | tableid |
fieldid | fieldid |
locktype | lock type |
searchParams | search parameters |
returnRows | rows to return |
Definition at line 2323 of file SubTransaction.cc.
References indexSearch(), returnRow_s::locktype, msgrcv, NOTFOUNDLOCK, nonLockingIndexEntry_s::rowid, MessageSubtransactionCmd::rowids, selectrows(), MessageTransaction::transaction_s::transaction_pendingcmdid, and MessageTransaction::transactionStruct.
Referenced by processTransactionMessage().
|
private |
return rows
tableid | tableid |
rowids | list of rowids to return |
locktype | lock type |
pendingcmdid | pending commad of sending Transaction |
returnRows | rows to return |
Definition at line 2313 of file SubTransaction.cc.
References msgrcv, schemaPtr, Table::selectrows(), subtransactionid, and Schema::tables.
Referenced by processTransactionMessage(), and searchReturn1().
|
private |
new unique index entry
tableid | tableid |
fieldid | fieldid |
rowid | rowid |
engineid | engineid |
val | field value |
Definition at line 625 of file SubTransaction.cc.
References fieldInput_u::boolean, Index::boolLockQueue, fieldInput_u::character, Index::charLockQueue, lockingIndexEntry::engineid, lockQueueIndexEntry::entry, fieldInput_u::floating, Index::floatLockQueue, INDEXLOCK, Index::indexmaptype, INDEXPENDINGLOCK, fieldInput_u::integer, Index::intLockQueue, msgrcv, NOLOCK, NOTFOUNDLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, schemaPtr, fieldValue_s::str, Index::stringLockQueue, lockingIndexEntry::subtransactionid, subtransactionid, Schema::tables, lockQueueIndexEntry::tacmdentrypoint, MessageTransaction::transaction_s::transaction_pendingcmdid, MessageTransaction::transaction_s::transaction_tacmdentrypoint, MessageTransaction::transactionStruct, trimspace(), fieldInput_u::uinteger, Index::uintLockQueue, uniquebool, Index::uniqueBoolIndex, uniquechar, Index::uniqueCharIndex, uniquecharx, uniquefloat, Index::uniqueFloatIndex, uniqueint, Index::uniqueIntIndex, Index::uniqueStringIndex, uniqueuint, Index::uniqueUintIndex, uniquevarchar, unorderedbool, Index::unorderedBoolIndex, unorderedchar, Index::unorderedCharIndex, unorderedcharx, unorderedfloat, Index::unorderedFloatIndex, unorderedint, Index::unorderedIntIndex, Index::unorderedStringIndex, unordereduint, Index::unorderedUintIndex, unorderedvarchar, and fieldValue_s::value.
Referenced by processTransactionMessage().
|
private |
modify row
tableid | tableid |
rowid | rowid |
row | new row |
Definition at line 2292 of file SubTransaction.cc.
References schemaPtr, subtransactionid, Schema::tables, and Table::updaterow().
Referenced by processTransactionMessage().
|
friend |
Definition at line 55 of file SubTransaction.h.
|
private |
Definition at line 214 of file SubTransaction.h.
Referenced by SubTransaction().
|
private |
Definition at line 216 of file SubTransaction.h.
Referenced by drainIndexLockQueue(), drainRowLockQueue(), replyTransaction(), SubTransaction(), and ~SubTransaction().
|
private |
Definition at line 215 of file SubTransaction.h.
Referenced by processTransactionMessage(), replyTransaction(), searchReturn1(), selectrows(), and uniqueIndex().
|
private |
Definition at line 217 of file SubTransaction.h.
Referenced by commitRollbackUnlock(), deleterow(), drainIndexLockQueue(), drainRowLockQueue(), indexSearch(), newrow(), processTransactionMessage(), selectrows(), SubTransaction(), uniqueIndex(), and updaterow().
|
private |
Definition at line 211 of file SubTransaction.h.
Referenced by commitRollbackUnlock(), deleterow(), newrow(), processTransactionMessage(), replyTransaction(), selectrows(), SubTransaction(), uniqueIndex(), updaterow(), and ~SubTransaction().
|
private |
Definition at line 212 of file SubTransaction.h.
Referenced by replyTransaction().
|
private |
Definition at line 213 of file SubTransaction.h.
Referenced by drainIndexLockQueue(), and drainRowLockQueue().