#include <kernel_types.h>#include "TransporterDefinitions.hpp"Include dependency graph for TransporterCallback.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define TE_DO_DISCONNECT 0x8000 |
| enum TransporterError |
Definition at line 87 of file TransporterCallback.hpp.
00087 { 00088 TE_NO_ERROR = 0, 00096 TE_ERROR_CLOSING_SOCKET = 0x1, 00097 00107 TE_ERROR_IN_SELECT_BEFORE_ACCEPT = 0x2, 00108 00116 TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT, 00117 00125 TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT, 00126 00134 TE_COULD_NOT_CREATE_SOCKET = 0x5, 00135 00143 TE_COULD_NOT_BIND_SOCKET = 0x6, 00144 00152 TE_LISTEN_FAILED = 0x7, 00153 00163 TE_ACCEPT_RETURN_ERROR = 0x8 00164 00172 ,TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT 00173 00183 ,TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT 00184 00188 ,TE_SHM_IPC_PERMANENT = 0x21 00189 00198 ,TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd 00199 00208 ,TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe 00209 00218 ,TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf 00219 00220 ,TE_TOO_SMALL_SIGID = 0x10 00221 ,TE_TOO_LARGE_SIGID = 0x11 00222 ,TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT 00223 ,TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT 00224 00232 ,TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT 00233 00241 ,TE_SIGNAL_LOST = 0x15 00242 00248 ,TE_SEND_BUFFER_FULL = 0x16 00249 00256 ,TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22 00257 00265 ,TE_SCI_LINK_ERROR = 0x0017 00266 00274 ,TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT 00275 00281 ,TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT 00282 00290 ,TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT 00291 00298 ,TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT 00299 00307 ,TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT 00308 00316 ,TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNECT 00317 00324 ,TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT 00325 00334 ,TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNECT 00335 00342 ,TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT 00343 00344 /* Used 0x21 */ 00345 /* Used 0x22 */ 00346 };
| int checkJobBuffer | ( | ) |
Report connection broken
Check to see if jobbbuffers are starting to get full and if so call doJob
Definition at line 420 of file basicTransporterTest.cpp.
Referenced by TransporterRegistry::performReceive().
Here is the caller graph for this function:

| void execute | ( | void * | callbackObj, | |
| SignalHeader *const | header, | |||
| Uint8 | prio, | |||
| Uint32 *const | theData, | |||
| LinearSectionPtr | ptr[3] | |||
| ) |
The execute function : Handle received signal
Handle received signal immediately to avoid any unnecessary copying of data, allocation of memory and other things. Copying of data could be interesting to support several priority levels and to support a special memory structure when executing the signals. Neither of those are interesting when receiving data in the NDBAPI. The NDBAPI will thus read signal data directly as it was written by the sender (SCI sender is other node, Shared memory sender is other process and TCP/IP sender is the OS that writes the TCP/IP message into a message buffer).
Block number == 2047 is used to signal a signal that consists of multiple instances of the same signal. This is an effort to package the signals so as to avoid unnecessary communication overhead since TCP/IP has a great performance impact.
Since it contains at least two data packets we will first copy the signal data to safe place.
Set the data length of the signal and the receivers block reference and then call the API.
The signal was aimed for the Cluster Manager. We handle it immediately here.
Report
Reply
Definition at line 338 of file basicTransporterTest.cpp.
References abort(), API_CLUSTERMGR, API_PACKED, AlterTableRep::changeType, AlterTableRep::CT_ALTERED, ArbitMgr::doChoose(), ArbitMgr::doStart(), ArbitMgr::doStop(), ClusterMgr::execAPI_REGCONF(), ClusterMgr::execAPI_REGREF(), ClusterMgr::execAPI_REGREQ(), ClusterMgr::execNF_COMPLETEREP(), ClusterMgr::execNODE_FAILREP(), SignalLoggerManager::executeSignal(), SignalLoggerManager::flushSignalLog(), TransporterFacade::for_each(), TransporterFacade::ThreadData::get(), NdbApiSignal::getDataPtrSend(), NdbApiSignal::getLength(), GSN_ALTER_TABLE_REP, GSN_API_REGCONF, GSN_API_REGREF, GSN_API_REGREQ, GSN_ARBIT_CHOOSEREQ, GSN_ARBIT_STARTREQ, GSN_ARBIT_STOPORD, GSN_NF_COMPLETEREP, GSN_NODE_FAILREP, GSN_SUB_GCP_COMPLETE_ACK, GSN_SUB_GCP_COMPLETE_REP, TransporterFacade::ThreadData::Object_Execute::m_executeFunction, TransporterFacade::m_globalDictCache, SignalHeader::m_noOfSections, TransporterFacade::ThreadData::Object_Execute::m_object, TransporterFacade::m_threads, memcpy, MIN_API_BLOCK_NO, ndbout(), NULL, numberToRef(), TransporterFacade::ownId(), p, refToBlock(), refToNode(), TransporterFacade::sendSignalUnCond(), NdbApiSignal::setDataPtr(), AlterTableRep::tableId, AlterTableRep::tableVersion, TransporterFacade::theArbitMgr, TransporterFacade::theClusterMgr, SignalHeader::theLength, TransporterFacade::theOwnId, SignalHeader::theReceiversBlockNumber, SignalHeader::theSendersBlockRef, SignalHeader::theVerId_signalNumber, and TRP_DEBUG.
00340 { 00341 const NodeId nodeId = refToNode(header->theSendersBlockRef); 00342 00343 ndbout << "Recieved prio " << (int)prio << " signal from node: " 00344 << nodeId 00345 << " gsn = " << header->theVerId_signalNumber << endl; 00346 checkData(header, prio, theData, ptr); 00347 ndbout << " Data is ok!\n" << endl; 00348 00349 signalReceived[nodeId]++; 00350 00351 if(prio == 0) 00352 sendSignalTo(nodeId, 1); 00353 else 00354 tReg->setPerformState(nodeId, PerformDisconnect); 00355 }
Here is the call graph for this function:

| void reportConnect | ( | void * | callbackObj, | |
| NodeId | nodeId | |||
| ) |
Report connection established
Definition at line 398 of file basicTransporterTest.cpp.
References ndbout_c().
Referenced by TransporterRegistry::report_connect().
00398 { 00399 char buf[255]; 00400 sprintf(buf, "reportConnect(%d)", nodeId); 00401 ndbout << buf << endl; 00402 tReg->setPerformState(nodeId, PerformIO); 00403 00404 sendSignalTo(nodeId, 0); 00405 }
Here is the call graph for this function:

Here is the caller graph for this function:

Report connection broken
Definition at line 411 of file basicTransporterTest.cpp.
References ndbout_c().
Referenced by OSE_Transporter::disconnectOrd(), TransporterRegistry::report_disconnect(), and reportError().
00411 { 00412 char buf[255]; 00413 sprintf(buf, "reportDisconnect(%d)", nodeId); 00414 ndbout << buf << endl; 00415 if(signalReceived[nodeId] < 2) 00416 tReg->setPerformState(nodeId, PerformConnect); 00417 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void reportError | ( | void * | callbackObj, | |
| NodeId | nodeId, | |||
| TransporterError | errorCode, | |||
| const char * | info = 0 | |||
| ) |
Report error
Definition at line 331 of file TransporterCallback.cpp.
References ndbout_c(), and TE_DO_DISCONNECT.
Referenced by OSE_Receiver::checkWaitStack(), OSE_Receiver::doReceive(), OSE_Receiver::insertWaitStack(), TransporterRegistry::prepareSend(), Transporter::report_error(), and TransporterRegistry::unpack().
00333 { 00334 #ifdef DEBUG_TRANSPORTER 00335 ndbout_c("reportError (%d, 0x%x) %s", nodeId, errorCode, info ? info : "") 00336 #endif 00337 00338 DBUG_ENTER("reportError"); 00339 DBUG_PRINT("info",("nodeId %d errorCode: 0x%x info: %s", 00340 nodeId, errorCode, info)); 00341 00342 switch (errorCode) 00343 { 00344 case TE_SIGNAL_LOST_SEND_BUFFER_FULL: 00345 { 00346 char msg[64]; 00347 snprintf(msg, sizeof(msg), "Remote note id %d.%s%s", nodeId, 00348 info ? " " : "", info ? info : ""); 00349 ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, 00350 msg, __FILE__, NST_ErrorHandler); 00351 } 00352 case TE_SIGNAL_LOST: 00353 { 00354 char msg[64]; 00355 snprintf(msg, sizeof(msg), "Remote node id %d,%s%s", nodeId, 00356 info ? " " : "", info ? info : ""); 00357 ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST, 00358 msg, __FILE__, NST_ErrorHandler); 00359 } 00360 case TE_SHM_IPC_PERMANENT: 00361 { 00362 char msg[128]; 00363 snprintf(msg, sizeof(msg), 00364 "Remote node id %d.%s%s", 00365 nodeId, info ? " " : "", info ? info : ""); 00366 ErrorReporter::handleError(NDBD_EXIT_CONNECTION_SETUP_FAILED, 00367 msg, __FILE__, NST_ErrorHandler); 00368 } 00369 default: 00370 break; 00371 } 00372 00373 if(errorCode & TE_DO_DISCONNECT){ 00374 reportDisconnect(callbackObj, nodeId, errorCode); 00375 } 00376 00377 SignalT<3> signalT; 00378 Signal &signal= *(Signal*)&signalT; 00379 memset(&signal.header, 0, sizeof(signal.header)); 00380 00381 00382 if(errorCode & TE_DO_DISCONNECT) 00383 signal.theData[0] = NDB_LE_TransporterError; 00384 else 00385 signal.theData[0] = NDB_LE_TransporterWarning; 00386 00387 signal.theData[1] = nodeId; 00388 signal.theData[2] = errorCode; 00389 00390 signal.header.theLength = 3; 00391 signal.header.theSendersSignalId = 0; 00392 signal.header.theSendersBlockRef = numberToRef(0, globalData.ownId); 00393 globalScheduler.execute(&signal, JBA, CMVMI, GSN_EVENT_REP); 00394 00395 DBUG_VOID_RETURN; 00396 }
Here is the call graph for this function:

Here is the caller graph for this function:

Report average receive length in bytes (4096 last receives)
Definition at line 388 of file basicTransporterTest.cpp.
References ndbout_c().
Referenced by TCP_Transporter::doReceive().
00388 { 00389 char buf[255]; 00390 sprintf(buf, "reportReceiveLen(%d, %d)", nodeId, (Uint32)(bytes/count)); 00391 ndbout << buf << endl; 00392 }
Here is the call graph for this function:

Here is the caller graph for this function:

Report average send length in bytes (4096 last sends)
Definition at line 378 of file basicTransporterTest.cpp.
References ndbout_c().
Referenced by TCP_Transporter::doSend().
00378 { 00379 char buf[255]; 00380 sprintf(buf, "reportSendLen(%d, %d)", nodeId, (Uint32)(bytes/count)); 00381 ndbout << buf << endl; 00382 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void transporter_recv_from | ( | void * | callbackObj, | |
| NodeId | node | |||
| ) |
Definition at line 509 of file TransporterCallback.cpp.
Referenced by TransporterRegistry::performReceive().
00509 { 00510 globalData.m_nodeInfo[nodeId].m_heartbeat_cnt= 0; 00511 return; 00512 }
Here is the caller graph for this function:

1.4.7

