void DblqhProxy::sendPREP_DROP_TAB_CONF(Signal* signal, Uint32 ssId) { Ss_PREP_DROP_TAB_REQ& ss = ssFind<Ss_PREP_DROP_TAB_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); PrepDropTabConf* conf = (PrepDropTabConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; conf->tableId = ss.m_req.tableId; sendSignal(dictRef, GSN_PREP_DROP_TAB_CONF, signal, PrepDropTabConf::SignalLength, JBB); } else { jam(); PrepDropTabRef* ref = (PrepDropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); ref->senderData = ss.m_req.senderData; ref->tableId = ss.m_req.tableId; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_PREP_DROP_TAB_REF, signal, PrepDropTabRef::SignalLength, JBB); } ssRelease<Ss_PREP_DROP_TAB_REQ>(ssId); }
void DblqhProxy::sendLQH_TRANSCONF(Signal* signal, Uint32 ssId) { Ss_LQH_TRANSREQ& ss = ssFind<Ss_LQH_TRANSREQ>(ssId); if (ss.m_conf.operationStatus != LqhTransConf::LastTransConf) { jam(); LqhTransConf* conf = (LqhTransConf*)signal->getDataPtrSend(); *conf = ss.m_conf; conf->tcRef = ss.m_req.senderData; sendSignal(ss.m_req.senderRef, GSN_LQH_TRANSCONF, signal, LqhTransConf::SignalLength, JBB); // more replies from this worker skipConf(ss); } if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); LqhTransConf* conf = (LqhTransConf*)signal->getDataPtrSend(); conf->tcRef = ss.m_req.senderData; conf->lqhNodeId = getOwnNodeId(); conf->operationStatus = LqhTransConf::LastTransConf; sendSignal(ss.m_req.senderRef, GSN_LQH_TRANSCONF, signal, LqhTransConf::SignalLength, JBB); } else { ndbrequire(false); } ssRelease<Ss_LQH_TRANSREQ>(ssId); }
void DbtcProxy::sendDROP_FK_IMPL_CONF(Signal* signal, Uint32 ssId) { Ss_DROP_FK_IMPL_REQ& ss = ssFind<Ss_DROP_FK_IMPL_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); DropFKImplConf* conf = (DropFKImplConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; sendSignal(dictRef, GSN_DROP_FK_IMPL_CONF, signal, DropFKImplConf::SignalLength, JBB); } else { jam(); DropFKImplRef* ref = (DropFKImplRef*)signal->getDataPtrSend(); ref->senderRef = reference(); ref->senderData = ss.m_req.senderData; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_DROP_FK_IMPL_REF, signal, DropFKImplRef::SignalLength, JBB); } ssRelease<Ss_DROP_FK_IMPL_REQ>(ssId); }
void DbtcProxy::sendABORT_ALL_CONF(Signal* signal, Uint32 ssId) { Ss_ABORT_ALL_REQ& ss = ssFind<Ss_ABORT_ALL_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); AbortAllConf* conf = (AbortAllConf*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; sendSignal(dictRef, GSN_ABORT_ALL_CONF, signal, AbortAllConf::SignalLength, JBB); } else { AbortAllRef* ref = (AbortAllRef*)signal->getDataPtrSend(); ref->senderData = ss.m_req.senderData; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_ABORT_ALL_REF, signal, AbortAllRef::SignalLength, JBB); } ssRelease<Ss_ABORT_ALL_REQ>(ssId); }
void DbgdmProxy::sendTAB_COMMITCONF(Signal* signal, Uint32 ssId) { Ss_TAB_COMMITREQ& ss = ssFind<Ss_TAB_COMMITREQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); TabCommitConf* conf = (TabCommitConf*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; conf->nodeId = getOwnNodeId(); conf->tableId = ss.m_req.tableId; sendSignal(dictRef, GSN_TAB_COMMITCONF, signal, TabCommitConf::SignalLength, JBB); } else { jam(); TabCommitRef* ref = (TabCommitRef*)signal->getDataPtrSend(); ref->senderData = ss.m_req.senderData; ref->nodeId = getOwnNodeId(); ref->tableId = ss.m_req.tableId; sendSignal(dictRef, GSN_TAB_COMMITREF, signal, TabCommitRef::SignalLength, JBB); return; } ssRelease<Ss_TAB_COMMITREQ>(ssId); }
void PgmanProxy::sendEND_LCP_CONF(Signal* signal, Uint32 ssId) { Ss_END_LCP_REQ& ss = ssFind<Ss_END_LCP_REQ>(ssId); BlockReference senderRef = ss.m_req.senderRef; if (!lastReply(ss)) { jam(); return; } if (!lastExtra(signal, ss)) { jam(); return; } if (ss.m_error == 0) { jam(); EndLcpConf* conf = (EndLcpConf*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; conf->senderRef = reference(); sendSignal(senderRef, GSN_END_LCP_CONF, signal, EndLcpConf::SignalLength, JBB); } else { ndbrequire(false); } ssRelease<Ss_END_LCP_REQ>(ssId); }
void DbgdmProxy::sendALTER_TAB_CONF(Signal* signal, Uint32 ssId) { Ss_ALTER_TAB_REQ& ss = ssFind<Ss_ALTER_TAB_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); AlterTabConf* conf = (AlterTabConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; sendSignal(dictRef, GSN_ALTER_TAB_CONF, signal, AlterTabConf::SignalLength, JBB); } else { jam(); AlterTabRef* ref = (AlterTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); ref->senderData = ss.m_req.senderData; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_ALTER_TAB_REF, signal, AlterTabConf::SignalLength, JBB); } ssRelease<Ss_ALTER_TAB_REQ>(ssId); }
void DblqhProxy::sendGCP_SAVECONF(Signal* signal, Uint32 ssId) { Ss_GCP_SAVEREQ& ss = ssFind<Ss_GCP_SAVEREQ>(ssId); if (!lastReply(ss)) return; if (ss.m_error == 0) { GCPSaveConf* conf = (GCPSaveConf*)signal->getDataPtrSend(); conf->dihPtr = ss.m_req.dihPtr; conf->nodeId = getOwnNodeId(); conf->gci = ss.m_req.gci; sendSignal(ss.m_req.dihBlockRef, GSN_GCP_SAVECONF, signal, GCPSaveConf::SignalLength, JBB); } else { jam(); GCPSaveRef* ref = (GCPSaveRef*)signal->getDataPtrSend(); ref->dihPtr = ss.m_req.dihPtr; ref->nodeId = getOwnNodeId(); ref->gci = ss.m_req.gci; ref->errorCode = ss.m_error; sendSignal(ss.m_req.dihBlockRef, GSN_GCP_SAVEREF, signal, GCPSaveRef::SignalLength, JBB); } ssRelease<Ss_GCP_SAVEREQ>(ssId); }
void PgmanProxy::sendEND_LCPCONF(Signal* signal, Uint32 ssId) { Ss_END_LCPREQ& ss = ssFind<Ss_END_LCPREQ>(ssId); BlockReference senderRef = ss.m_req.senderRef; if (!lastReply(ss)) { jam(); return; } if (!ss.m_extraLast) { jam(); ss.m_extraLast = true; ss.m_worker = c_workers - 1; // send to last PGMAN ss.m_workerMask.set(ss.m_worker); SectionHandle handle(this); (this->*ss.m_sendREQ)(signal, ss.m_ssId, &handle); return; } if (ss.m_error == 0) { jam(); EndLcpConf* conf = (EndLcpConf*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; conf->senderRef = reference(); sendSignal(senderRef, GSN_END_LCPCONF, signal, EndLcpConf::SignalLength, JBB); } else { ndbrequire(false); } ssRelease<Ss_END_LCPREQ>(ssId); }
void DbtcProxy::sendTC_CLOPSIZECONF(Signal* signal, Uint32 ssId) { Ss_TC_CLOPSIZEREQ& ss = ssFind<Ss_TC_CLOPSIZEREQ>(ssId); if (!lastReply(ss)) return; signal->theData[0] = ss.m_req[0]; sendSignal(ss.m_req[1], GSN_TC_CLOPSIZECONF, signal, 1, JBB); ssRelease<Ss_TC_CLOPSIZEREQ>(ssId); }
void DbgdmProxy::sendTC_SCHVERCONF(Signal* signal, Uint32 ssId) { Ss_TC_SCHVERREQ& ss = ssFind<Ss_TC_SCHVERREQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; TcSchVerConf* conf = (TcSchVerConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; sendSignal(dictRef, GSN_TC_SCHVERCONF, signal, TcSchVerConf::SignalLength, JBB); ssRelease<Ss_TC_SCHVERREQ>(ssId); }
void DblqhProxy::sendCREATE_TAB_CONF(Signal* signal, Uint32 ssId) { Ss_CREATE_TAB_REQ& ss = ssFind<Ss_CREATE_TAB_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; { const CreateTabConf* conf = (const CreateTabConf*)signal->getDataPtr(); ss.m_lqhConnectPtr[ss.m_worker] = conf->lqhConnectPtr; } if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); CreateTabConf* conf = (CreateTabConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; conf->lqhConnectPtr = ssId; sendSignal(dictRef, GSN_CREATE_TAB_CONF, signal, CreateTabConf::SignalLength, JBB); // inform DBTUP proxy CreateTabReq* req = (CreateTabReq*)signal->getDataPtrSend(); *req = ss.m_req; EXECUTE_DIRECT(DBTUP, GSN_CREATE_TAB_REQ, signal, CreateTabReq::SignalLength); Uint32 tableId = ss.m_req.tableId; ndbrequire(tableId < c_tableRecSize); c_tableRec[tableId] = 1; } else { CreateTabRef* ref = (CreateTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); ref->senderData = ss.m_req.senderData; ref->errorCode = ss.m_error; ref->errorLine = 0; ref->errorKey = 0; ref->errorStatus = 0; sendSignal(dictRef, GSN_CREATE_TAB_REF, signal, CreateTabRef::SignalLength, JBB); ssRelease<Ss_CREATE_TAB_REQ>(ssId); } }
void TrpmanProxy::sendENABLE_COMCONF(Signal *signal, Uint32 ssId) { jam(); Ss_ENABLE_COMREQ& ss = ssFind<Ss_ENABLE_COMREQ>(ssId); if (!lastReply(ss)) { jam(); return; } EnableComReq* conf = (EnableComReq*)signal->getDataPtr(); *conf = ss.m_req; sendSignal(conf->m_senderRef, GSN_ENABLE_COMCONF, signal, EnableComReq::SignalLength, JBB); ssRelease<Ss_ENABLE_COMREQ>(ssId); }
void DbtcProxy::sendGCP_TCFINISHED(Signal* signal, Uint32 ssId) { Ss_GCP_NOMORETRANS& ss = ssFind<Ss_GCP_NOMORETRANS>(ssId); if (!lastReply(ss)) return; GCPTCFinished* conf = (GCPTCFinished*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; conf->gci_hi = ss.m_req.gci_hi; conf->gci_lo = ss.m_req.gci_lo; conf->tcFailNo = ss.m_minTcFailNo; sendSignal(ss.m_req.senderRef, GSN_GCP_TCFINISHED, signal, GCPTCFinished::SignalLength, JBB); ssRelease<Ss_GCP_NOMORETRANS>(ssId); }
void TrpmanProxy::sendCLOSE_COMCONF(Signal *signal, Uint32 ssId) { jam(); Ss_CLOSE_COMREQ& ss = ssFind<Ss_CLOSE_COMREQ>(ssId); if (!lastReply(ss)) { jam(); return; } CloseComReqConf* conf = (CloseComReqConf*)signal->getDataPtrSend(); *conf = ss.m_req; sendSignal(QMGR_REF, GSN_CLOSE_COMCONF, signal, CloseComReqConf::SignalLength, JBB); ssRelease<Ss_CLOSE_COMREQ>(ssId); }
void DblqhProxy::sendEXEC_SR_2(Signal* signal, Uint32 ssId) { Ss_EXEC_SR_2& ss = ssFind<Ss_EXEC_SR_2>(ssId); if (!lastReply(ss)) { jam(); return; } NodeBitmask nodes; nodes.assign(NdbNodeBitmask::Size, ss.m_sig.sr_nodes); NodeReceiverGroup rg(DBLQH, nodes); signal->theData[0] = ss.m_sig.nodeId; sendSignal(rg, ss.m_gsn, signal, 1, JBB); ssRelease<Ss_EXEC_SR_2>(ssId); }
void DblqhProxy::sendLQHADDATTCONF(Signal* signal, Uint32 ssId) { Ss_LQHADDATTREQ& ss = ssFind<Ss_LQHADDATTREQ>(ssId); Ss_CREATE_TAB_REQ& ss_main = ssFind<Ss_CREATE_TAB_REQ>(ssId); BlockReference dictRef = ss_main.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); LqhAddAttrConf* conf = (LqhAddAttrConf*)signal->getDataPtrSend(); conf->senderData = ss.m_req.senderData; conf->senderAttrPtr = ss.m_req.senderAttrPtr; sendSignal(dictRef, GSN_LQHADDATTCONF, signal, LqhAddAttrConf::SignalLength, JBB); if (ss_main.m_req.noOfAttributes == 0) { jam(); /** * All the attributes has been processed * release create_table object */ ssRelease<Ss_CREATE_TAB_REQ>(ssId); } } else { jam(); LqhAddAttrRef* ref = (LqhAddAttrRef*)signal->getDataPtrSend(); ref->senderData = ss.m_req.senderData; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_LQHADDATTREF, signal, LqhAddAttrRef::SignalLength, JBB); ssRelease<Ss_CREATE_TAB_REQ>(ssId); } ssRelease<Ss_LQHADDATTREQ>(ssId); }
void DblqhProxy::sendSTART_RECREQ_2(Signal* signal, Uint32 ssId) { Ss_START_RECREQ_2& ss = ssFind<Ss_START_RECREQ_2>(ssId); const Ss_START_RECREQ_2::Req* req = (const Ss_START_RECREQ_2::Req*)signal->getDataPtr(); if (firstReply(ss)) { ss.m_req = *req; } else { jam(); /* * Fragments can be started from different lcpId's. LGMAN must run * UNDO until lowest lcpId. Each DBLQH instance computes the lowest * lcpId in START_FRAGREQ. In MT case the proxy further computes * the lowest of the lcpId's from worker instances. */ if (req->lcpId < ss.m_req.lcpId) { jam(); ss.m_req.lcpId = req->lcpId; } ndbrequire(ss.m_req.proxyBlockNo == req->proxyBlockNo); } if (!lastReply(ss)) return; { Ss_START_RECREQ_2::Req* req = (Ss_START_RECREQ_2::Req*)signal->getDataPtrSend(); *req = ss.m_req; BlockReference ref = numberToRef(req->proxyBlockNo, getOwnNodeId()); sendSignal(ref, GSN_START_RECREQ, signal, Ss_START_RECREQ_2::Req::SignalLength, JBB); } }
void DblqhProxy::sendDROP_TAB_CONF(Signal* signal, Uint32 ssId) { Ss_DROP_TAB_REQ& ss = ssFind<Ss_DROP_TAB_REQ>(ssId); BlockReference dictRef = ss.m_req.senderRef; if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); DropTabConf* conf = (DropTabConf*)signal->getDataPtrSend(); conf->senderRef = reference(); conf->senderData = ss.m_req.senderData; conf->tableId = ss.m_req.tableId; sendSignal(dictRef, GSN_DROP_TAB_CONF, signal, DropTabConf::SignalLength, JBB); // inform DBTUP proxy DropTabReq* req = (DropTabReq*)signal->getDataPtrSend(); *req = ss.m_req; EXECUTE_DIRECT(DBTUP, GSN_DROP_TAB_REQ, signal, DropTabReq::SignalLength); } else { jam(); DropTabRef* ref = (DropTabRef*)signal->getDataPtrSend(); ref->senderRef = reference(); ref->senderData = ss.m_req.senderData; ref->tableId = ss.m_req.tableId; ref->errorCode = ss.m_error; sendSignal(dictRef, GSN_DROP_TAB_REF, signal, DropTabConf::SignalLength, JBB); } ssRelease<Ss_DROP_TAB_REQ>(ssId); }
void DblqhProxy::sendSTART_RECCONF(Signal* signal, Uint32 ssId) { Ss_START_RECREQ& ss = ssFind<Ss_START_RECREQ>(ssId); if (!lastReply(ss)) return; if (ss.m_error == 0) { jam(); /** * There should be no disk-ops in flight here...check it */ signal->theData[0] = 12003; sendSignal(LGMAN_REF, GSN_DUMP_STATE_ORD, signal, 1, JBB); StartRecConf* conf = (StartRecConf*)signal->getDataPtrSend(); conf->startingNodeId = getOwnNodeId(); conf->senderData = ss.m_req.senderData; sendSignal(ss.m_req.senderRef, GSN_START_RECCONF, signal, StartRecConf::SignalLength, JBB); } else { ndbrequire(false); } { Uint32 i; for (i = 0; i < ss.m_req2cnt; i++) { jam(); Uint32 ssId2 = ss.m_req2[i].m_ssId; ssRelease<Ss_START_RECREQ_2>(ssId2); } } ssRelease<Ss_START_RECREQ>(ssId); }
void CLastFm::managerReply(QNetworkReply *pReply, QString mtd) { int size1, size2; size1 = methods.size(); size2 = bytearrays.size(); if (size1 != size2) qDebug() << "WARNING ! Queues have different sizes !"; else qDebug() << "BEGIN: Queue size is" << size1; if (size1 <= 0) return; QByteArray data=pReply->readAll(); QString content(data); qDebug() << "lastFm manager reply :" << content; emit lastReply(content); qDebug() << "URL was :" << pReply->url().toString(); // JEŚLI RESPONSE JEST OK, TO USUWAMY JUŻ TEN REQUEST if (content.contains("status=\"ok\"")) { if (!methods.isEmpty()) methods.removeFirst(); if (!bytearrays.isEmpty()) bytearrays.removeFirst(); } // ===================== // // auth.getMobileSession // // ===================== // if (mtd == "auth.getMobileSession") { qDebug() << "I got auth.getMobileSession response..."; if (content.contains("status=\"ok\"")) { QRegExp myRegExp(".+<key>"); content.remove(myRegExp); myRegExp = QRegExp("</key>.+"); content.remove(myRegExp); lastFmSessionKey = content; isSessionOK = true; } else { isSessionOK = false; if (content.contains("error code=\"4\"")) { qDebug() << "Check your last.fm user/pass"; emit errSignal("Check your last.fm user/pass"); } else if (content.contains("error code=\"11\"")) { qDebug() << "Last.fm is temporarily offline"; emit errSignal("Last.fm is temporarily offline"); } else { qDebug() << "Some strange error occured and I couldn't get lastFm session"; emit errSignal("I couldn't get last.fm session"); } } } // ====================== // // track.updateNowPlaying // // ====================== // else if (mtd == "track.updateNowPlaying") { qDebug() << "I got track.updateNowPlaying response..."; if (content.contains("status=\"ok\"")) { // } else { if (content.contains("error code=\"9\"")) { qDebug() << "Invalid session key, I'm re-authenticating..."; isSessionOK = false; getSession(); } else if (content.contains("error code=\"11\"")) { qDebug() << "Last.fm is temporarily offline"; emit errSignal("Last.fm is temporarily offline"); } else if (content.contains("error code=\"16\"")) { qDebug() << "Last.fm is temporarily unavailable"; emit errSignal("Last.fm is temporarily unavailable"); } else { qDebug() << "Some strange error occured and I couldn't updateNowPlaying"; emit errSignal("I couldn't update \"Now Playing\""); } } } // ========== // // track.love // // ========== // else if (mtd == "track.love") { qDebug() << "I got track.love response..."; if (content.contains("status=\"ok\"")) { if (!myLoveQueue[0].isEmpty()) { myLoveQueue[0].removeAt(0); myLoveQueue[1].removeAt(0); myLoveQueue[2].removeAt(0); } if (!myLoveQueue[0].isEmpty()) { loveSongs(); } } } // ============ // // track.unlove // // ============ // else if (mtd == "track.unlove") { qDebug() << "I got track.unlove response..."; if (content.contains("status=\"ok\"")) { if (!myUnloveQueue[0].isEmpty()) { myUnloveQueue[0].removeAt(0); myUnloveQueue[1].removeAt(0); myUnloveQueue[2].removeAt(0); } if (!myUnloveQueue[0].isEmpty()) { unloveSongs(); } } } // ============== // // track.scrobble // // ============== // else if (mtd == "track.scrobble") { qDebug() << "I got track.scrobble response..."; int oldSize = myLastQueue[0].size(); int newSize; if (content.contains("status=\"ok\"")) { if (myLastQueue[0].size() > 10) { for (int i = 0 ; i <= 9 ; i++) { myLastQueue[0].removeAt(0); myLastQueue[1].removeAt(0); myLastQueue[2].removeAt(0); myLastQueue[3].removeAt(0); } newSize = myLastQueue[0].size(); lastFmSent = lastFmSent + (oldSize - newSize); emit sentChanged(lastFmSent); lastFmQueued = lastFmQueued - (oldSize - newSize); emit queueChanged(lastFmQueued); scrobbleSongs(); } else { int tmpSize = myLastQueue[0].size(); for (int i = 0 ; i < tmpSize ; i++) { myLastQueue[0].removeAt(0); myLastQueue[1].removeAt(0); myLastQueue[2].removeAt(0); myLastQueue[3].removeAt(0); } emit ifSongIsPlayingUpdateNowPlaying(); newSize = myLastQueue[0].size(); lastFmSent = lastFmSent + (oldSize - newSize); emit sentChanged(lastFmSent); lastFmQueued = lastFmQueued - (oldSize - newSize); emit queueChanged(lastFmQueued); } } else qDebug() << "There was an error sending track(s) to Last.fm"; } // ==================== // // other Method name... // // ==================== // else { qDebug() << "Strange response, ignoring..."; } size1 = methods.size(); size2 = bytearrays.size(); if (size1 != size2) qDebug() << "WARNING ! Queues have different sizes !"; else qDebug() << "END: Queue size is" << size1; // if (size1 > 0) popMyQ(); }