InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SubTransaction.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Mark Travis <mtravis15432+src@gmail.com>
3  * All rights reserved. No warranty, explicit or implicit, provided.
4  *
5  * This file is part of InfiniSQL(tm).
6 
7  * InfiniSQL is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 3
9  * as published by the Free Software Foundation.
10  *
11  * InfiniSQL is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with InfiniSQL. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
30 #ifndef INFINISQLSUBTRANSACTION_H
31 #define INFINISQLSUBTRANSACTION_H
32 
33 #include "gch.h"
34 #include "Engine.h"
35 
36 // both SubTransaction and Transaction use this, for different purposes, so
37 // not all fields have meaning for both classes.
38 
48 {
49 public:
51  int64_t transactionidarg, int64_t domainidarg,
52  class Engine *enginePtrarg);
53  virtual ~SubTransaction();
54 
55  friend class Engine;
56 
57 private:
63  void processTransactionMessage(class Message *msgrcvarg);
70  void commitRollbackUnlock(vector<rowOrField_s> *rowOrFields,
71  enginecmd_e cmd);
78  void processRowLockQueue(int64_t tableid, int64_t rowid); // keep
87  void drainRowLockQueue(int64_t tableid, int64_t rowid); // keep
95  void processIndexLockQueue(int64_t tableid, int64_t fieldid,
96  fieldValue_s *val);
106  void drainIndexLockQueue(int64_t tableid, int64_t fieldid,
107  fieldValue_s *val);
116  int64_t newrow(int64_t tableid, std::string row);
128  locktype_e uniqueIndex(int64_t tableid, int64_t fieldid, int64_t rowid,
129  int64_t engineid, fieldValue_s *val);
139  int64_t updaterow(int64_t tableid, int64_t rowid, std::string *row);
148  int64_t deleterow(int64_t tableid, int64_t rowid);
159  int64_t deleterow(int64_t tableid, int64_t rowid, int64_t forward_rowid,
160  int64_t forward_engineid);
161  void indexSearch(int64_t tableid, int64_t fieldid,
162  searchParams_s *searchParameters,
163  vector<nonLockingIndexEntry_s> *indexHits);
173  void selectrows(int64_t tableid, vector<int64_t> *rowids,
174  locktype_e locktype, int64_t pendingcmdid,
175  vector<returnRow_s> *returnRows);
189  void searchReturn1(int64_t tableid, int64_t fieldid, locktype_e locktype,
190  searchParams_s &searchParams,
191  vector<returnRow_s> &returnRows);
197  void replyTransaction(void *data);
207  void replyTransaction(class MessageTransaction &sndRef,
208  class MessageTransaction &rcvRef);
209 
210  //private:
213  int64_t transactionid;
214  int64_t domainid;
215  class Message *msgrcv;
218 };
219 
220 #endif /* INFINISQLSUBTRANSACTION_H */