当前位置: 首页>>代码示例>>C++>>正文


C++ NdbTransaction::receiveTCKEYCONF方法代码示例

本文整理汇总了C++中NdbTransaction::receiveTCKEYCONF方法的典型用法代码示例。如果您正苦于以下问题:C++ NdbTransaction::receiveTCKEYCONF方法的具体用法?C++ NdbTransaction::receiveTCKEYCONF怎么用?C++ NdbTransaction::receiveTCKEYCONF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NdbTransaction的用法示例。


在下文中一共展示了NdbTransaction::receiveTCKEYCONF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleReceivedSignal

/****************************************************************************
void handleReceivedSignal(NdbApiSignal* aSignal);

Parameters:     aSignal: The signal object.
Remark:         Send all operations belonging to this connection. 
*****************************************************************************/
void	
Ndb::handleReceivedSignal(const NdbApiSignal* aSignal,
			  const LinearSectionPtr ptr[3])
{
  NdbOperation* tOp;
  NdbIndexOperation* tIndexOp;
  NdbTransaction* tCon;
  int tReturnCode = -1;
  const Uint32* tDataPtr = aSignal->getDataPtr();
  const Uint32 tWaitState = theImpl->theWaiter.get_state();
  const Uint32 tSignalNumber = aSignal->readSignalNumber();
  const Uint32 tFirstData = *tDataPtr;
  const Uint32 tLen = aSignal->getLength();
  Uint32 tNewState = tWaitState;
  void * tFirstDataPtr;
  NdbWaiter *t_waiter = &theImpl->theWaiter;

  /* Update cached Min Db node version */
  theCachedMinDbNodeVersion = theImpl->m_transporter_facade->getMinDbNodeVersion();

  if (likely(NdbImpl::recordGSN(tSignalNumber)))
  {
    Uint32 secs = aSignal->m_noOfSections;
    theImpl->incClientStat(BytesRecvdCount,
                           ((aSignal->getLength() << 2) +
                            ((secs > 2)? ptr[2].sz << 2: 0) + 
                            ((secs > 1)? ptr[1].sz << 2: 0) +
                            ((secs > 0)? ptr[0].sz << 2: 0)));
  }
  
  /*
    In order to support 64 bit processes in the application we need to use
    id's rather than a direct pointer to the object used. It is also a good
    idea that one cannot corrupt the application code by sending a corrupt
    memory pointer.
    
    All signals received by the API requires the first data word to be such
    an id to the receiving object.
  */
  
  switch (tSignalNumber){
  case GSN_TCKEYCONF:
  case GSN_TCINDXCONF:
    {
      const TcKeyConf * const keyConf = (TcKeyConf *)tDataPtr;
      if (tFirstData != RNIL)
      {
        tFirstDataPtr = int2void(tFirstData);
        if (tFirstDataPtr == 0) goto InvalidSignal;
        tCon = void2con(tFirstDataPtr);
      }
      else
      {
        tCon = lookupTransactionFromOperation(keyConf);
        if (tCon == NULL) goto InvalidSignal;
      }
      const BlockReference aTCRef = aSignal->theSendersBlockRef;

      if ((tCon->checkMagicNumber() == 0) &&
          (tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
        tReturnCode = tCon->receiveTCKEYCONF(keyConf, tLen);
        if (tReturnCode != -1) {
          completedTransaction(tCon);
        }//if

	if(TcKeyConf::getMarkerFlag(keyConf->confInfo)){
	  NdbTransaction::sendTC_COMMIT_ACK(theImpl,
                                            theCommitAckSignal,
                                            keyConf->transId1, 
                                            keyConf->transId2,
                                            aTCRef);
	}
      
	return;
      }//if
      goto InvalidSignal;
      
      return;
    }
  case GSN_TRANSID_AI:{
    tFirstDataPtr = int2void(tFirstData);
    if (tFirstDataPtr){
      NdbReceiver* const tRec = void2rec(tFirstDataPtr);
      if(!tRec->checkMagicNumber()){
	return;
      }
      tCon = tRec->getTransaction();
      if((tCon!=NULL) &&
	 tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){
	Uint32 com;
	if(aSignal->m_noOfSections > 0){
	  if(tRec->getType()==NdbReceiver::NDB_QUERY_OPERATION){
	    com = ((NdbQueryOperationImpl*)(tRec->m_owner))
              ->execTRANSID_AI(ptr[0].p, ptr[0].sz);
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的NdbTransaction::receiveTCKEYCONF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。