21 #include <SimulatedBlock.hpp>
25 #include <NodeBitmask.hpp>
26 #include <signaldata/GetTabInfo.hpp>
27 #include <SafeMutex.hpp>
41 void execSTTOR(
Signal* signal);
43 void execREAD_CONFIG_REQ(
Signal* signal);
45 void execCONTINUEB(
Signal* signal);
46 void execNODE_FAILREP(
Signal* signal);
48 void execCREATE_FILE_IMPL_REQ(
Signal* signal);
49 void execCREATE_FILEGROUP_IMPL_REQ(
Signal* signal);
50 void execDROP_FILE_IMPL_REQ(
Signal* signal);
51 void execDROP_FILEGROUP_IMPL_REQ(
Signal* signal);
53 void execSTART_RECREQ(
Signal*);
56 void execFSOPENREF(
Signal*);
58 void execFSREADREF(
Signal*);
61 void execFSCLOSEREF(
Signal*);
62 void execFSCLOSECONF(
Signal*);
69 void execLCP_FRAG_ORD(
Signal*);
73 void execGET_TABINFOREQ(
Signal*);
77 GetTabInfoRef::ErrorCode errorCode);
96 Uint32 m_tablespace_ptr_i;
110 Uint32 m_first_free_extent;
111 Uint32 m_lcp_free_extent_head;
112 Uint32 m_lcp_free_extent_tail;
113 Uint32 m_offset_data_pages;
115 Uint32 m_used_extent_cnt;
116 Uint32 m_extent_headers_per_extent_page;
122 Uint32 m_extent_pages;
123 Uint32 m_requestInfo;
126 Uint32 m_loading_extent_page;
139 Uint32 hashValue()
const {
142 bool equal(
const Datafile&
rec)
const {
143 return m_file_no == rec.m_file_no;
160 Uint32 m_tablespace_id;
173 Uint32 m_extent_size;
176 Uint32 m_logfile_group_id;
189 Uint32 hashValue()
const {
193 return key == rec.key;
216 void client_lock(BlockNumber
block,
int line);
217 void client_unlock(BlockNumber
block,
int line);
222 void load_extent_page_callback(
Signal*, Uint32, Uint32);
224 Uint32,Uint32,Uint32);
230 unsigned committed_bits);
235 void scan_tablespace(
Signal*, Uint32 ptrI);
236 void scan_datafile(
Signal*, Uint32, Uint32);
243 void release_extent_pages_callback(
Signal*, Uint32, Uint32);
247 Uint32 m_extent_pages;
248 Uint32 m_extent_size;
250 Uint32 m_extent_page_no;
253 struct req lookup_extent(Uint32 page_no, const Datafile*)
const;
254 Uint32 calc_page_no_in_extent(Uint32 page_no,
const struct req* val)
const;
259 Tsman::lookup_extent(Uint32 page_no,
const Datafile * filePtrP)
const
262 val.m_extent_size = filePtrP->m_extent_size;
263 val.m_extent_pages = filePtrP->m_online.m_offset_data_pages;
264 Uint32 per_page = filePtrP->m_online.m_extent_headers_per_extent_page;
267 (page_no - val.m_extent_pages) / val.m_extent_size + per_page;
269 val.m_extent_page_no = extent / per_page;
270 val.m_extent_no = extent % per_page;
276 Tsman::calc_page_no_in_extent(Uint32 page_no,
const Tsman::req* val)
const
278 return (page_no - val->m_extent_pages) % val->m_extent_size;
288 Uint32 m_fragment_id;
289 Uint32 m_tablespace_id;
291 DEBUG_OUT_DEFINES(TSMAN);
295 Uint32
table, Uint32 fragment, Uint32 tablespaceId,
297 Uint32 bno = block->number();
298 Uint32 ino = block->instance();
299 m_block= numberToBlock(bno, ino);
303 m_fragment_id= fragment;
304 m_tablespace_id= tablespaceId;
307 D(
"client ctor " << bno <<
"/" << ino
308 << V(m_table_id) << V(m_fragment_id) << V(m_tablespace_id));
310 m_tsman->client_lock(m_block, 0);
317 Uint32 bno = blockToMain(m_block);
318 Uint32 ino = blockToInstance(m_block);
320 D(
"client dtor " << bno <<
"/" << ino);
322 m_tsman->client_unlock(m_block, 0);
365 unsigned* uncommitted,
unsigned* committed);
393 #include <signaldata/Extent.hpp>
400 req->request.table_id = m_table_id;
401 req->request.fragment_id = m_fragment_id;
402 req->request.tablespace_id = m_tablespace_id;
405 if(req->reply.errorCode == 0){
406 * key = req->reply.page_id;
407 D(
"alloc_extent" << V(*key) << V(req->reply.page_count));
408 return req->reply.page_count;
410 return -(int)req->reply.errorCode;
421 req->request.table_id = m_table_id;
422 req->request.fragment_id = m_fragment_id;
423 req->request.tablespace_id = m_tablespace_id;
426 if(req->reply.errorCode == 0){
428 D(
"alloc_page_from_extent" << V(*key) << V(bits) << V(req->bits));
431 return -(int)req->reply.errorCode;
440 req->request.key = *key;
441 req->request.table_id = m_table_id;
442 req->request.tablespace_id = m_tablespace_id;
443 req->request.lsn_hi = (Uint32)(lsn >> 32);
444 req->request.lsn_lo = (Uint32)(lsn & 0xFFFFFFFF);
447 if(req->reply.errorCode == 0){
448 D(
"free_extent" << V(*key) << V(lsn));
451 return -(int)req->reply.errorCode;
458 unsigned committed_bits)
460 D(
"update_page_free_bits" << V(*key) << V(committed_bits));
461 return m_tsman->update_page_free_bits(m_signal, key, committed_bits);
467 unsigned* uncommited,
470 return m_tsman->get_page_free_bits(m_signal, key, uncommited, commited);
477 return m_tsman->unmap_page(m_signal, key, uncommitted_bits);
483 unsigned committed_bits)
485 return m_tsman->restart_undo_page_free_bits(m_signal,