~michaeleguo/ubuntu/trusty/percona-xtradb-cluster-5.5/arm64fix

« back to all changes in this revision

Viewing changes to storage/ndb/test/include/HugoAsynchTransactions.hpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-10 14:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20140210144423-f2134l2gxuvq2m6l
Tags: upstream-5.5.34-25.9+dfsg
ImportĀ upstreamĀ versionĀ 5.5.34-25.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */
 
15
 
 
16
#ifndef HUGO_ASYNCH_TRANSACTIONS_HPP
 
17
#define HUGO_ASYNCH_TRANSACTIONS_HPP
 
18
 
 
19
 
 
20
#include <NDBT.hpp>
 
21
#include <HugoCalculator.hpp>
 
22
#include <HugoTransactions.hpp>
 
23
 
 
24
class HugoAsynchTransactions : private HugoTransactions {
 
25
public:
 
26
  HugoAsynchTransactions(const NdbDictionary::Table&);
 
27
  ~HugoAsynchTransactions();
 
28
  int loadTableAsynch(Ndb*, 
 
29
                      int records = 0,
 
30
                      int batch = 1,
 
31
                      int trans = 1,
 
32
                      int operations = 1);
 
33
  int pkReadRecordsAsynch(Ndb*, 
 
34
                          int records = 0,
 
35
                          int batch= 1,
 
36
                          int trans = 1,
 
37
                          int operations = 1);
 
38
  int pkUpdateRecordsAsynch(Ndb*, 
 
39
                            int records = 0,
 
40
                            int batch= 1,
 
41
                            int trans = 1,
 
42
                            int operations = 1);
 
43
  int pkDelRecordsAsynch(Ndb*, 
 
44
                         int records = 0,
 
45
                         int batch = 1,
 
46
                         int trans = 1,
 
47
                         int operations = 1);
 
48
  void transactionCompleted();
 
49
 
 
50
  long getTransactionsCompleted();
 
51
 
 
52
private:  
 
53
  enum NDB_OPERATION {NO_INSERT, NO_UPDATE, NO_READ, NO_DELETE};
 
54
 
 
55
  void allocTransactions(int trans);
 
56
  void deallocTransactions();
 
57
 
 
58
  int executeAsynchOperation(Ndb*,                    
 
59
                             int records,
 
60
                             int batch,
 
61
                             int trans,
 
62
                             int operations,
 
63
                             NDB_OPERATION theOperation,
 
64
                             ExecType theType = Commit);
 
65
 
 
66
  long transactionsCompleted;
 
67
  int numTransactions;
 
68
  NdbConnection** transactions;
 
69
};
 
70
 
 
71
 
 
72
 
 
73
#endif
 
74