MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DbtupClient.cpp
1 /* Copyright 2008 Sun Microsystems, Inc.
2  All rights reserved. Use is subject to license terms.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 
17 #define DBTUP_C
18 #include "Dbtup.hpp"
19 #include "DbtupProxy.hpp"
20 
21 Dbtup_client::Dbtup_client(SimulatedBlock* block,
22  SimulatedBlock* dbtup)
23 {
24  m_block = numberToBlock(block->number(), block->instance());
25 
26  if (dbtup->isNdbMtLqh() && dbtup->instance() == 0) {
27  m_dbtup_proxy = (DbtupProxy*)dbtup;
28  m_dbtup = 0;
29  } else {
30  m_dbtup_proxy = 0;
31  m_dbtup = (Dbtup*)dbtup;
32  }
33 }
34 
35 // LGMAN
36 
37 void
38 Dbtup_client::disk_restart_undo(Signal* signal, Uint64 lsn,
39  Uint32 type, const Uint32 * ptr, Uint32 len)
40 {
41  if (m_dbtup_proxy != 0) {
42  m_dbtup_proxy->disk_restart_undo(signal, lsn, type, ptr, len);
43  return;
44  }
45  m_dbtup->disk_restart_undo(signal, lsn, type, ptr, len);
46 }
47 
48 // TSMAN
49 
50 int
51 Dbtup_client::disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId,
52  const Local_key* key, Uint32 pages)
53 {
54  if (m_dbtup_proxy != 0) {
55  return
56  m_dbtup_proxy->disk_restart_alloc_extent(tableId, fragId, key, pages);
57  }
58  return m_dbtup->disk_restart_alloc_extent(tableId, fragId, key, pages);
59 }
60 
61 void
62 Dbtup_client::disk_restart_page_bits(Uint32 tableId, Uint32 fragId,
63  const Local_key* key, Uint32 bits)
64 {
65  if (m_dbtup_proxy != 0) {
66  m_dbtup_proxy->disk_restart_page_bits(tableId, fragId, key, bits);
67  return;
68  }
69  m_dbtup->disk_restart_page_bits(tableId, fragId, key, bits);
70 }