MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DbtupProxy.hpp
1 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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 NDB_DBTUP_PROXY
17 #define NDB_DBTUP_PROXY
18 
19 #include <LocalProxy.hpp>
20 #include <signaldata/CreateTab.hpp>
21 #include <signaldata/DropTab.hpp>
22 #include <signaldata/BuildIndxImpl.hpp>
23 
24 class DbtupProxy : public LocalProxy {
25 public:
27  virtual ~DbtupProxy();
28  BLOCK_DEFINES(DbtupProxy);
29 
30 protected:
31  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
32 
33  class Pgman* c_pgman; // PGMAN proxy
34 
35  Uint32 c_tableRecSize;
36  Uint8* c_tableRec; // bool => table exists
37 
38  // GSN_READ_CONFIG_REQ
39  virtual void callREAD_CONFIG_REQ(Signal*);
40 
41  // GSN_STTOR
42  virtual void callSTTOR(Signal*);
43 
44  // GSN_CREATE_TAB_REQ
45  void execCREATE_TAB_REQ(Signal*);
46  // GSN_DROP_TAB_REQ
47  void execDROP_TAB_REQ(Signal*);
48 
49  // GSN_BUILD_INDX_IMPL_REQ
51  BuildIndxImplReq m_req;
53  m_sendREQ = (SsFUNCREQ)&DbtupProxy::sendBUILD_INDX_IMPL_REQ;
54  m_sendCONF = (SsFUNCREP)&DbtupProxy::sendBUILD_INDX_IMPL_CONF;
55  }
56  enum { poolSize = 1 };
57  static SsPool<Ss_BUILD_INDX_IMPL_REQ>& pool(LocalProxy* proxy) {
58  return ((DbtupProxy*)proxy)->c_ss_BUILD_INDX_IMPL_REQ;
59  }
60  };
61  SsPool<Ss_BUILD_INDX_IMPL_REQ> c_ss_BUILD_INDX_IMPL_REQ;
62  void execBUILD_INDX_IMPL_REQ(Signal*);
63  void sendBUILD_INDX_IMPL_REQ(Signal*, Uint32 ssId, SectionHandle*);
64  void execBUILD_INDX_IMPL_CONF(Signal*);
65  void execBUILD_INDX_IMPL_REF(Signal*);
66  void sendBUILD_INDX_IMPL_CONF(Signal*, Uint32 ssId);
67 
68  // client methods
69  friend class Dbtup_client;
70 
71  // LGMAN
72 
73  struct Proxy_undo {
74  enum { MaxData = 20 + MAX_TUPLE_SIZE_IN_WORDS };
75  Uint32 m_type;
76  Uint32 m_len;
77  const Uint32* m_ptr;
78  Uint32 m_data[MaxData]; // copied from m_ptr at once
79  Uint64 m_lsn;
80  // from undo entry and page
81  Local_key m_key;
82  Uint32 m_page_id;
83  Uint32 m_table_id;
84  Uint32 m_fragment_id;
85  Uint32 m_instance_no;
86  enum {
87  SendToAll = 1,
88  ReadTupPage = 2,
89  GetInstance = 4,
90  NoExecute = 8,
91  SendUndoNext = 16
92  };
93  Uint32 m_actions;
94  bool m_in_use;
95  Proxy_undo();
96  };
97  Proxy_undo c_proxy_undo;
98 
99  void disk_restart_undo(Signal*, Uint64 lsn,
100  Uint32 type, const Uint32 * ptr, Uint32 len);
101 
102  // next 3 are helper methods
103  void disk_restart_undo_callback(Signal*, Uint32, Uint32 page_id);
104 
105  void disk_restart_undo_finish(Signal*);
106 
107  void disk_restart_undo_send(Signal*, Uint32 i);
108 
109  // TSMAN
110 
111  int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
112  const Local_key* key, Uint32 pages);
113  void disk_restart_page_bits(Uint32 tableId, Uint32 fragId,
114  const Local_key* key, Uint32 bits);
115 };
116 
117 #endif