InfiniSQL
v0.1.2-alpha
Massive Scale Transaction Processing
|
Global struct & enum types, global function declarations, global symbols in general. More...
#include "infinisql.h"
Go to the source code of this file.
Classes | |
struct | cfg_s |
global config parameters More... | |
struct | serventIdentity_s |
orphan More... | |
struct | procedures_s |
stored procedure creator and destructor function pointers More... | |
struct | newDeadLockLists_s |
items to add to wait-for graph More... | |
struct | rowOrField_s |
data items describing manipulation request More... | |
struct | searchParams_s |
describes how to perform an SQL search expression predicate More... | |
struct | nonLockingIndexEntry_s |
index map value for non-unique indices More... | |
struct | subtransactionCmd_s |
command contents between Transaction and Subtransaction More... | |
struct | listenerStruct_s |
used by Listner to know what to listen to More... | |
struct | locked_s |
orphan? More... | |
struct | lockFieldValue_s |
for tracking lock types for transactions with unique index entries More... | |
struct | stagedRow_s |
rows and unique index entries worked on by Transaction More... | |
Typedefs | |
typedef nonLockingIndexEntry_s | indexEntry_s |
typedef boost::unordered_map < int64_t, class Schema * > | domainidToSchemaMap |
Functions | |
void | debug (char *, int, char *) |
void | trimspace (string &) |
void | msgpack2Vector (vector< string > *resultvector, char *payload, int64_t length) |
convert msgpack to a vector of strings More... | |
char | setdeleteflag (char *c) |
for delete operations on row More... | |
bool | getdeleteflag (char c) |
check if row operation is delete More... | |
char | cleardeleteflag (char *c) |
clear delete operation on row More... | |
char | setinsertflag (char *c) |
for insert operations on row More... | |
bool | getinsertflag (char c) |
check if row operation is insert More... | |
char | clearinsertflag (char *c) |
clear insert operation on row More... | |
char | clearlockedflag (char *c) |
clear locked flag on row More... | |
locktype_e | getlocktype (char c) |
check if row is locked and type More... | |
bool | setwritelock (char *c) |
set write lock on row More... | |
bool | setreadlock (char *c) |
set read lock on row More... | |
char | setreplacedeleteflag (char *c) |
set delete as part of replace row flag More... | |
bool | getreplacedeleteflag (char c) |
get whether or not row is deleted as part of row replacement More... | |
char | clearreplacedeleteflag (char *c) |
clear row as deleted as part of row replacement More... | |
int16_t | getPartitionid (fieldValue_s &fieldVal, fieldtype_e type, int16_t numpartitions) |
hash of field value for partition id More... | |
void | like2Regex (string &likeStr) |
might be orpha, but convert LIKE operand to regex More... | |
bool | compareFields (fieldtype_e type, const fieldValue_s &val1, const fieldValue_s &val2) |
compare field values for equality More... | |
void | stagedRow2ReturnRow (const stagedRow_s &stagedRow, returnRow_s &returnRow) |
convert stagedRow_s to returnRow_s More... | |
void | setprio () |
set real-time priority More... | |
Variables | |
cfg_s | cfgs |
FILE * | logfile |
std::string | zmqsocket |
void * | zmqcontext |
std::string | storedprocprefix |
class Topology | nodeTopology |
pthread_mutex_t | nodeTopologyMutex |
pthread_mutex_t | connectionsMutex |
std::vector< class MboxProducer * > | socketAffinity |
std::vector< listenertype_e > | listenerTypes |
Global struct & enum types, global function declarations, global symbols in general.
Definition in file defs.h.
#define BUILTIN_STATUS_NOTOK 1 |
Definition at line 34 of file defs.h.
Referenced by UserSchemaMgr::addcolumn(), createSchema(), Schema::createTable(), and UserSchemaMgr::createtable().
#define BUILTIN_STATUS_OK 0 |
Definition at line 33 of file defs.h.
Referenced by Engine::addcolumn(), UserSchemaMgr::addcolumn(), createSchema(), Schema::createTable(), UserSchemaMgr::createtable(), Engine::deleteindex(), UserSchemaMgr::deleteindex(), Engine::deleteschema(), UserSchemaMgr::deleteschema(), Engine::deletetable(), UserSchemaMgr::deletetable(), TransactionAgent::schemaBoilerplate(), TransactionAgent::TAaddcolumn(), TransactionAgent::TAdeleteindex(), TransactionAgent::TAdeleteschema(), and TransactionAgent::TAdeletetable().
#define BUILTINADDCOLUMN 5 |
Definition at line 241 of file defs.h.
Referenced by TransactionAgent::addcolumn(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define BUILTINCREATESCHEMA 3 |
Definition at line 239 of file defs.h.
Referenced by TransactionAgent::createschema(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define BUILTINCREATETABLE 4 |
Definition at line 240 of file defs.h.
Referenced by TransactionAgent::createtable(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define BUILTINDELETEINDEX 6 |
Definition at line 242 of file defs.h.
Referenced by TransactionAgent::deleteindex(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define BUILTINDELETESCHEMA 8 |
Definition at line 244 of file defs.h.
Referenced by TransactionAgent::deleteschema(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define BUILTINDELETETABLE 7 |
Definition at line 243 of file defs.h.
Referenced by TransactionAgent::deletetable(), Engine::Engine(), TransactionAgent::TransactionAgent(), and UserSchemaMgr::UserSchemaMgr().
#define DELETEFLAG 0 |
Definition at line 507 of file defs.h.
Referenced by cleardeleteflag(), getdeleteflag(), and setdeleteflag().
#define INSERTFLAG 1 |
Definition at line 508 of file defs.h.
Referenced by clearinsertflag(), getinsertflag(), and setinsertflag().
#define LOCKEDFLAG 2 |
Definition at line 509 of file defs.h.
Referenced by clearlockedflag(), getlocktype(), setreadlock(), and setwritelock().
#define LOCKTYPEFLAG 3 |
Definition at line 510 of file defs.h.
Referenced by getlocktype(), setreadlock(), and setwritelock().
#define MSGRECEIVEBATCHSIZE 500 |
Definition at line 43 of file defs.h.
Referenced by DeadlockMgr::DeadlockMgr(), Engine::Engine(), and TransactionAgent::TransactionAgent().
#define NUMSOCKETS 1048576 |
Definition at line 37 of file defs.h.
Referenced by Listener::Listener(), and Pg::pgclosesocket().
#define OBGWMSGBATCHSIZE 5000 |
Definition at line 44 of file defs.h.
Referenced by MboxProducer::sendMsg().
#define OP_SCHEMA 2 |
Definition at line 253 of file defs.h.
Referenced by Operation::Operation().
#define OPERAND_AGGREGATE 'g' |
Definition at line 225 of file defs.h.
Referenced by Larxer::pushaggregate(), and Statement::resolveTableFields2().
#define OPERAND_BOOLEAN 'l' |
Definition at line 230 of file defs.h.
Referenced by Larxer::printstack(), Transaction::sqlPredicate(), Statement::subqueryExists(), Statement::subqueryScalar(), and Statement::subqueryUnique().
#define OPERAND_FIELDID 'h' |
Definition at line 226 of file defs.h.
Referenced by Statement::andPredicate(), Ast::normalizeSetAssignmentOperand(), Statement::resolveFieldNames(), Statement::resolveTableFields2(), Transaction::sqlPredicate(), and Statement::stagedPredicate().
#define OPERAND_FLOAT 'f' |
Definition at line 224 of file defs.h.
Referenced by Ast::evaluate(), Ast::evaluateAssignment(), Ast::normalizeSetAssignmentOperand(), Larxer::printstack(), Transaction::sqlPredicate(), Statement::subqueryScalar(), and Ast::toFloat().
#define OPERAND_IDENTIFIER 'b' |
Definition at line 220 of file defs.h.
Referenced by Larxer::consumeGroupby(), Larxer::printstack(), Statement::resolveFieldNames(), Statement::resolveTableFields2(), and Transaction::sqlPredicate().
#define OPERAND_INTEGER 'e' |
Definition at line 223 of file defs.h.
Referenced by Ast::evaluate(), Ast::evaluateAssignment(), Ast::normalizeSetAssignmentOperand(), Larxer::printstack(), Transaction::sqlPredicate(), Statement::subqueryScalar(), and Ast::toFloat().
#define OPERAND_NULL 'i' |
Definition at line 227 of file defs.h.
Referenced by Statement::branchtotype(), Statement::continueUpdate(), Ast::evaluate(), and Statement::subqueryScalar().
#define OPERAND_PARAMETER 'c' |
Definition at line 221 of file defs.h.
Referenced by Ast::evaluate(), Ast::normalizeSetAssignmentOperand(), and Larxer::printstack().
#define OPERAND_STRING 'a' |
Definition at line 219 of file defs.h.
Referenced by Ast::evaluate(), Ast::evaluateAssignment(), Ast::normalizeSetAssignmentOperand(), Larxer::printstack(), Transaction::sqlPredicate(), and Statement::subqueryScalar().
#define OPERAND_SUBQUERY 'd' |
Definition at line 222 of file defs.h.
Referenced by Larxer::consumeExpression(), Ast::evaluate(), Ast::normalizeSetAssignmentOperand(), Larxer::printstack(), and Statement::subqueryScalar().
#define PAYLOADSIZE 128 |
Definition at line 36 of file defs.h.
Referenced by TransactionAgent::readSocket(), and TransactionAgent::sendResponse().
#define REPLACEDELETEFLAG 4 |
Definition at line 511 of file defs.h.
Referenced by clearreplacedeleteflag(), getreplacedeleteflag(), and setreplacedeleteflag().
#define SERIALIZEDMAXSIZE 1048576 |
Global configs
Definition at line 321 of file defs.h.
Referenced by IbGateway::IbGateway(), IbGateway::inbufhandler(), and ObGateway::ObGateway().
typedef boost::unordered_map<int64_t, class Schema *> domainidToSchemaMap |
typedef nonLockingIndexEntry_s indexEntry_s |
enum builtincmds_e |
enum deadlockchange_e |
type of change for DeadlockMgr wait-for graph
Enumerator | |
---|---|
ADDLOCKEDENTRY | |
ADDLOCKPENDINGENTRY | |
REMOVELOCKEDENTRY | |
REMOVELOCKPENDINGENTRY | |
TRANSITIONPENDINGTOLOCKEDENTRY |
Definition at line 517 of file defs.h.
enum enginecmd_e |
enum enginecmds_e |
enum indexmaptype_e |
types of maps for various indices
Definition at line 94 of file defs.h.
enum indextype_e |
enum listenertype_e |
enum maptype_e |
enum operationtype_e |
type of Operation (only currently used for SQL login)
Enumerator | |
---|---|
OPERATION_NONE | |
OPERATION_LOGIN |
enum payloadtype_e |
Message variant payloads.
tend to correspond with specific Message variant
Definition at line 191 of file defs.h.
enum pendingprimitive_e |
pending transactional activity
Definition at line 277 of file defs.h.
enum topic_e |
Message variant topics.
Definition at line 136 of file defs.h.
char cleardeleteflag | ( | char * | c) |
clear delete operation on row
c | rowdata_s flags |
Definition at line 156 of file main.cc.
References DELETEFLAG.
Referenced by Table::commitRollbackUnlock().
char clearinsertflag | ( | char * | c) |
clear insert operation on row
c | rowdata_s flags |
Definition at line 171 of file main.cc.
References INSERTFLAG.
char clearlockedflag | ( | char * | c) |
clear locked flag on row
c | rowdata_s flags |
Definition at line 200 of file main.cc.
References LOCKEDFLAG.
Referenced by Table::commitRollbackUnlock().
char clearreplacedeleteflag | ( | char * | c) |
clear row as deleted as part of row replacement
c | rowdata_s flags |
Definition at line 222 of file main.cc.
References REPLACEDELETEFLAG.
Referenced by Table::commitRollbackUnlock().
bool compareFields | ( | fieldtype_e | type, |
const fieldValue_s & | val1, | ||
const fieldValue_s & | val2 | ||
) |
compare field values for equality
type | field type |
val1 | operand 1 |
val2 | operand 2 |
Definition at line 305 of file main.cc.
References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, fieldValue_s::isnull, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.
Referenced by Statement::andPredicate(), Statement::stagedPredicate(), and Statement::subqueryUnique().
void debug | ( | char * | , |
int | , | ||
char * | |||
) |
bool getdeleteflag | ( | char | c) |
check if row operation is delete
c | rowdata_s flags |
Definition at line 151 of file main.cc.
References DELETEFLAG.
Referenced by Table::commitRollbackUnlock().
bool getinsertflag | ( | char | c) |
check if row operation is insert
c | rowdata_s flags |
Definition at line 166 of file main.cc.
References INSERTFLAG.
Referenced by Table::assignToLockQueue(), Table::commitRollbackUnlock(), and Table::getrows().
locktype_e getlocktype | ( | char | c) |
check if row is locked and type
c | rowdata_s flags |
Definition at line 205 of file main.cc.
References LOCKEDFLAG, LOCKTYPEFLAG, NOLOCK, READLOCK, and WRITELOCK.
Referenced by Table::commitRollbackUnlock(), Table::deleterow(), Table::getrows(), Table::selectrows(), and Table::updaterow().
int16_t getPartitionid | ( | fieldValue_s & | fieldVal, |
fieldtype_e | type, | ||
int16_t | numpartitions | ||
) |
hash of field value for partition id
fieldVal | field value |
type | field type |
numpartitions | number of partitions |
Definition at line 237 of file main.cc.
References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, FLOAT, fieldInput_u::floating, SpookyHash::Hash64(), INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.
Referenced by TransactionAgent::handledispatch().
bool getreplacedeleteflag | ( | char | c) |
get whether or not row is deleted as part of row replacement
c | rowdata_s flags |
Definition at line 227 of file main.cc.
References REPLACEDELETEFLAG.
Referenced by Table::commitRollbackUnlock().
void like2Regex | ( | string & | likeStr) |
might be orpha, but convert LIKE operand to regex
likeStr | LIKE operand |
Definition at line 289 of file main.cc.
Referenced by Statement::andPredicate(), Index::like(), and Index::notlike().
void msgpack2Vector | ( | vector< string > * | resultvector, |
char * | payload, | ||
int64_t | length | ||
) |
convert msgpack to a vector of strings
resultvector | output |
payload | msgpack data |
length | msgpack length |
Definition at line 133 of file main.cc.
Referenced by TransactionAgent::compile(), TransactionAgent::login(), TransactionAgent::newprocedure(), and UserSchemaMgr::UserSchemaMgr().
char setdeleteflag | ( | char * | c) |
for delete operations on row
c | rowdata_s flags |
Definition at line 146 of file main.cc.
References DELETEFLAG.
Referenced by Table::deleterow().
char setinsertflag | ( | char * | c) |
for insert operations on row
c | rowdata_s flags |
Definition at line 161 of file main.cc.
References INSERTFLAG.
Referenced by Table::newrow().
void setprio | ( | ) |
set real-time priority
for IbGateway and ObGateway to maximize throughput. Needs to be configured at OS level
Definition at line 424 of file main.cc.
References logfile, and RTPRIO.
Referenced by IbGateway::IbGateway(), and ObGateway::updateRemoteGateways().
bool setreadlock | ( | char * | c) |
set read lock on row
c | rowdata_s flags |
Definition at line 188 of file main.cc.
References LOCKEDFLAG, and LOCKTYPEFLAG.
Referenced by Table::commitRollbackUnlock(), Table::getrows(), and Table::selectrows().
char setreplacedeleteflag | ( | char * | c) |
set delete as part of replace row flag
c | rowdata_s flags |
Definition at line 232 of file main.cc.
References REPLACEDELETEFLAG.
Referenced by Table::deleterow().
bool setwritelock | ( | char * | c) |
set write lock on row
c | rowdata_s flags |
Definition at line 176 of file main.cc.
References LOCKEDFLAG, and LOCKTYPEFLAG.
Referenced by Table::getrows(), Table::newrow(), and Table::selectrows().
void stagedRow2ReturnRow | ( | const stagedRow_s & | stagedRow, |
returnRow_s & | returnRow | ||
) |
convert stagedRow_s to returnRow_s
stagedRow | input stagedRow_s |
returnRow | output returnRow_s |
Definition at line 396 of file main.cc.
References stagedRow_s::cmd, INSERT, returnRow_s::locktype, stagedRow_s::locktype, stagedRow_s::newRow, stagedRow_s::newrowid, NOCOMMAND, stagedRow_s::originalRow, stagedRow_s::originalrowid, returnRow_s::previoussubtransactionid, stagedRow_s::previoussubtransactionid, returnRow_s::row, returnRow_s::rowid, and UPDATE.
Referenced by Statement::branchtotype(), and Statement::stagedPredicate().
void trimspace | ( | string & | ) |
Definition at line 382 of file main.cc.
Referenced by Index::between(), Index::comparison(), Transaction::continueCommitTransaction(), Index::deleteNonuniqueEntry(), Index::deleteUniqueEntry(), Transaction::getengine(), Transaction::getEngineid(), Index::getequal_f(), Index::getnotequal(), Index::getnotin(), Index::insertNonuniqueEntry(), Index::like(), Index::notlike(), Index::replaceNonunique(), Index::replaceUnique(), and SubTransaction::uniqueIndex().
cfg_s cfgs |
Definition at line 37 of file main.cc.
Referenced by IbGateway::inbufhandler(), TransactionAgent::login(), ObGateway::ObGateway(), and TransactionAgent::TransactionAgent().
pthread_mutex_t connectionsMutex |
Definition at line 41 of file main.cc.
Referenced by Listener::Listener(), main(), and Pg::pgclosesocket().
std::vector<listenertype_e> listenerTypes |
Definition at line 45 of file main.cc.
Referenced by Listener::Listener(), and Pg::pgclosesocket().
FILE* logfile |
Definition at line 36 of file main.cc.
Referenced by UserSchemaMgr::addcolumn(), TransactionAgent::addcolumn(), Table::addfield(), Statement::andPredicate(), TransactionAgent::badMessageHandler(), Index::between(), TransactionAgent::changepassword(), Index::checkAndLock(), Transaction::checkLock(), Transaction::checkSqlLock(), Index::commitRollback(), SubTransaction::commitRollbackUnlock(), Table::commitRollbackUnlock(), Index::comparison(), Transaction::continueCommitTransaction(), Transaction::continueFetchRows(), Transaction::continueInsertRow(), Pg::continuePgCommitexplicit(), Pg::continuePgCommitimplicit(), Pg::continuePgFunc(), Pg::continuePgRollbackexplicit(), Pg::continuePgRollbackimplicit(), Transaction::continueReplaceRow(), Transaction::continueRollbackTransaction(), Transaction::continueSelectRows(), Transaction::continueSqlInsert(), Transaction::continueSqlPredicate(), Transaction::continueUnlockRow(), Transaction::continueUpdateRow(), TransactionAgent::createdomain(), UserSchemaMgr::createschema(), TransactionAgent::createschema(), UserSchemaMgr::createtable(), TransactionAgent::createtable(), TransactionAgent::createuser(), DeadlockMgr::DeadlockMgr(), debug(), TransactionAgent::deletedomain(), UserSchemaMgr::deleteindex(), TransactionAgent::deleteindex(), Table::deleterow(), UserSchemaMgr::deleteschema(), TransactionAgent::deleteschema(), UserSchemaMgr::deletetable(), TransactionAgent::deletetable(), Index::deleteUniqueEntry(), TransactionAgent::deleteuser(), SubTransaction::drainIndexLockQueue(), Engine::Engine(), Transaction::getengine(), Transaction::getEngineid(), Index::getequal_f(), Index::getnotequal(), Index::getnotin(), Index::getnotnulls(), Table::getrows(), IbGateway::IbGateway(), SubTransaction::indexSearch(), Pg::initcmd(), Listener::Listener(), TransactionAgent::login(), main(), Index::makeindex(), Table::makerow(), Topology::newActor(), Pg::pgclosesocket(), SubTransaction::processTransactionMessage(), Transaction::processTransactionMessage(), Index::regex(), IbGateway::removefds(), Index::replaceUnique(), TransactionAgent::schemaBoilerplate(), Transaction::select(), Table::selectrows(), Message::ser(), MessageSocket::ser(), MessageUserSchema::ser(), MessageDeadlock::ser(), MessageTransaction::ser(), MessageSubtransactionCmd::ser(), MessageCommitRollback::ser(), MessageDispatch::ser(), MessageAckDispatch::ser(), MessageApply::ser(), MessageAckApply::ser(), setprio(), Listener::startsocket(), TopologyMgr::TopologyMgr(), TransactionAgent::TransactionAgent(), Table::unmakerow(), ObGateway::updateRemoteGateways(), Table::updaterow(), and UserSchemaMgr::UserSchemaMgr().
class Topology nodeTopology |
Definition at line 39 of file main.cc.
Referenced by Transaction::continueCommitTransaction(), Transaction::getengine(), Transaction::getEngineid(), main(), Operation::Operation(), Transaction::select(), Transaction::sqlPredicate(), Transaction::sqlSelectAll(), TopologyMgr::TopologyMgr(), Mboxes::update(), TopologyMgr::updateGlobalConfig(), and TopologyMgr::updateLocalConfig().
pthread_mutex_t nodeTopologyMutex |
Definition at line 40 of file main.cc.
Referenced by main(), Mboxes::update(), TopologyMgr::updateGlobalConfig(), and TopologyMgr::updateLocalConfig().
std::vector<class MboxProducer *> socketAffinity |
Definition at line 44 of file main.cc.
Referenced by Listener::Listener(), and Pg::pgclosesocket().
std::string storedprocprefix |
Definition at line 43 of file main.cc.
Referenced by Pg::continueLogin(), and TransactionAgent::newprocedure().
void* zmqcontext |
Definition at line 42 of file main.cc.
Referenced by main(), and TopologyMgr::TopologyMgr().
std::string zmqsocket |
Definition at line 38 of file main.cc.
Referenced by main(), and TopologyMgr::TopologyMgr().