~Tablespace_client() { #ifdef VM_TRACE Uint32 bno = blockToMain(m_block); Uint32 ino = blockToInstance(m_block); #endif D("client dtor " << bno << "/" << ino); if (m_lock) m_tsman->client_unlock(m_block, 0); }
void PgmanProxy::update_lsn(Page_cache_client& caller, Local_key key, Uint64 lsn) { ndbrequire(blockToInstance(caller.m_block) == 0); SimulatedBlock* block = globalData.getBlock(caller.m_block); Pgman* worker = (Pgman*)extraWorkerBlock(); Page_cache_client pgman(block, worker); pgman.update_lsn(key, lsn); }
int PgmanProxy::drop_page(Page_cache_client& caller, Local_key key, Uint32 page_id) { ndbrequire(blockToInstance(caller.m_block) == 0); SimulatedBlock* block = globalData.getBlock(caller.m_block); Pgman* worker = (Pgman*)extraWorkerBlock(); Page_cache_client pgman(block, worker); int ret = pgman.drop_page(key, page_id); return ret; }
int PgmanProxy::get_page(Page_cache_client& caller, Signal* signal, Page_cache_client::Request& req, Uint32 flags) { ndbrequire(blockToInstance(caller.m_block) == 0); SimulatedBlock* block = globalData.getBlock(caller.m_block); Pgman* worker = (Pgman*)extraWorkerBlock(); Page_cache_client pgman(block, worker); int ret = pgman.get_page(signal, req, flags); caller.m_ptr = pgman.m_ptr; return ret; }
SimulatedBlock * getBlockInstance(BlockNumber fullBlockNo) { return getBlock(blockToMain(fullBlockNo), blockToInstance(fullBlockNo)); }
void Thrman::execDBINFO_SCANREQ(Signal* signal) { jamEntry(); DbinfoScanReq req= *(DbinfoScanReq*)signal->theData; const Ndbinfo::ScanCursor* cursor = CAST_CONSTPTR(Ndbinfo::ScanCursor, DbinfoScan::getCursorPtr(&req)); Ndbinfo::Ratelimit rl; switch(req.tableId) { case Ndbinfo::THREADBLOCKS_TABLEID: { Uint32 arr[NO_OF_BLOCKS]; Uint32 len = mt_get_blocklist(this, arr, NDB_ARRAY_SIZE(arr)); Uint32 pos = cursor->data[0]; for (; ; ) { Ndbinfo::Row row(signal, req); row.write_uint32(getOwnNodeId()); row.write_uint32(getThreadId()); // thr_no row.write_uint32(blockToMain(arr[pos])); // block_number row.write_uint32(blockToInstance(arr[pos])); // block_instance ndbinfo_send_row(signal, req, row, rl); pos++; if (pos == len) { jam(); break; } else if (rl.need_break(req)) { jam(); ndbinfo_send_scan_break(signal, req, rl, pos); return; } } break; } case Ndbinfo::THREADSTAT_TABLEID:{ ndb_thr_stat stat; mt_get_thr_stat(this, &stat); Ndbinfo::Row row(signal, req); row.write_uint32(getOwnNodeId()); row.write_uint32(getThreadId()); // thr_no row.write_string(stat.name); row.write_uint64(stat.loop_cnt); row.write_uint64(stat.exec_cnt); row.write_uint64(stat.wait_cnt); row.write_uint64(stat.local_sent_prioa); row.write_uint64(stat.local_sent_priob); row.write_uint64(stat.remote_sent_prioa); row.write_uint64(stat.remote_sent_priob); row.write_uint64(stat.os_tid); row.write_uint64(NdbTick_CurrentMillisecond()); struct ndb_rusage os_rusage; Ndb_GetRUsage(&os_rusage); row.write_uint64(os_rusage.ru_utime); row.write_uint64(os_rusage.ru_stime); row.write_uint64(os_rusage.ru_minflt); row.write_uint64(os_rusage.ru_majflt); row.write_uint64(os_rusage.ru_nvcsw); row.write_uint64(os_rusage.ru_nivcsw); ndbinfo_send_row(signal, req, row, rl); break; } default: break; } ndbinfo_send_scan_conf(signal, req, rl); }