16 #include "PgmanProxy.hpp"
18 #include <signaldata/DataFileOrd.hpp>
26 addRecSignal(GSN_LCP_FRAG_ORD, &PgmanProxy::execLCP_FRAG_ORD);
29 addRecSignal(GSN_END_LCP_REQ, &PgmanProxy::execEND_LCP_REQ);
30 addRecSignal(GSN_END_LCP_CONF, &PgmanProxy::execEND_LCP_CONF);
31 addRecSignal(GSN_RELEASE_PAGES_CONF, &PgmanProxy::execRELEASE_PAGES_CONF);
34 PgmanProxy::~PgmanProxy()
39 PgmanProxy::newWorker(Uint32 instanceNo)
41 return new Pgman(m_ctx, instanceNo);
47 PgmanProxy::execLCP_FRAG_ORD(
Signal* signal)
50 Uint32 ssId = getSsId(req);
51 Ss_LCP_FRAG_ORD& ss = ssSeize<Ss_LCP_FRAG_ORD>(ssId);
54 ssRelease<Ss_LCP_FRAG_ORD>(ssId);
60 Ss_LCP_FRAG_ORD& ss = ssFind<Ss_LCP_FRAG_ORD>(ssId);
63 sendSignalNoRelease(workerRef(ss.m_worker), GSN_LCP_FRAG_ORD,
64 signal, LcpFragOrd::SignalLength, JBB, handle);
70 PgmanProxy::execEND_LCP_REQ(
Signal* signal)
73 Uint32 ssId = getSsId(req);
74 Ss_END_LCP_REQ& ss = ssSeize<Ss_END_LCP_REQ>(ssId);
77 const Uint32 sb = refToBlock(ss.m_req.senderRef);
78 ndbrequire(sb == DBLQH || sb == LGMAN);
87 req->senderData = ssId;
88 req->senderRef = reference();
89 req->requestType = ReleasePagesReq::RT_RELEASE_UNLOCKED;
91 sendSignal(extraWorkerRef(), GSN_RELEASE_PAGES_REQ,
92 signal, ReleasePagesReq::SignalLength, JBB);
99 PgmanProxy::execRELEASE_PAGES_CONF(
Signal* signal)
102 Uint32 ssId = getSsId(conf);
103 Ss_END_LCP_REQ& ss = ssFind<Ss_END_LCP_REQ>(ssId);
110 Ss_END_LCP_REQ& ss = ssFind<Ss_END_LCP_REQ>(ssId);
114 req->senderData = ssId;
115 req->senderRef = reference();
116 sendSignalNoRelease(workerRef(ss.m_worker), GSN_END_LCP_REQ,
117 signal, EndLcpReq::SignalLength, JBB, handle);
121 PgmanProxy::execEND_LCP_CONF(
Signal* signal)
124 Uint32 ssId = conf->senderData;
125 Ss_END_LCP_REQ& ss = ssFind<Ss_END_LCP_REQ>(ssId);
126 recvCONF(signal, ss);
130 PgmanProxy::sendEND_LCP_CONF(
Signal* signal, Uint32 ssId)
132 Ss_END_LCP_REQ& ss = ssFind<Ss_END_LCP_REQ>(ssId);
133 BlockReference senderRef = ss.m_req.senderRef;
135 if (!lastReply(ss)) {
140 if (!lastExtra(signal, ss)) {
145 if (ss.m_error == 0) {
148 conf->senderData = ss.m_req.senderData;
149 conf->senderRef = reference();
150 sendSignal(senderRef, GSN_END_LCP_CONF,
151 signal, EndLcpConf::SignalLength, JBB);
156 ssRelease<Ss_END_LCP_REQ>(ssId);
171 ndbrequire(blockToInstance(caller.m_block) == 0);
175 int ret = pgman.get_page(signal, req, flags);
176 caller.m_ptr = pgman.m_ptr;
184 ndbrequire(blockToInstance(caller.m_block) == 0);
188 pgman.update_lsn(key, lsn);
195 ndbrequire(blockToInstance(caller.m_block) == 0);
199 int ret = pgman.drop_page(key, page_id);
213 Uint32 ret = worker->create_data_file();
215 for (i = 0; i < c_lqhWorkers; i++) {
217 send_data_file_ord(signal, i, ret,
218 DataFileOrd::CreateDataFile);
227 Uint32 ret = worker->alloc_data_file(file_no);
229 for (i = 0; i < c_lqhWorkers; i++) {
231 send_data_file_ord(signal, i, ret,
232 DataFileOrd::AllocDataFile, file_no);
241 worker->map_file_no(file_no, fd);
243 for (i = 0; i < c_lqhWorkers; i++) {
245 send_data_file_ord(signal, i, ~(Uint32)0,
246 DataFileOrd::MapFileNo, file_no, fd);
254 worker->free_data_file(file_no, fd);
256 for (i = 0; i < c_lqhWorkers; i++) {
258 send_data_file_ord(signal, i, ~(Uint32)0,
259 DataFileOrd::FreeDataFile, file_no, fd);
264 PgmanProxy::send_data_file_ord(
Signal* signal, Uint32 i, Uint32 ret,
265 Uint32 cmd, Uint32 file_no, Uint32 fd)
270 ord->file_no = file_no;
272 sendSignal(workerRef(i), GSN_DATA_FILE_ORD,
273 signal, DataFileOrd::SignalLength, JBB);