コード例 #1
0
ファイル: pmdEDU.cpp プロジェクト: jasonsungblog/SequoiaDB
   string _pmdEDUCB::toString() const
   {
      stringstream ss ;
      ss << "ID: " << _eduID << ", Type: " << _eduType << "["
         << getEDUName( _eduType ) << "], TID: " << _tid ;

      if ( _pSession )
      {
         ss << ", Session: " << _pSession->sessionName() ;
      }
      return ss.str() ;
   }
コード例 #2
0
ファイル: pmdEDU.cpp プロジェクト: jasonsungblog/SequoiaDB
 // PD_TRACE_DECLARE_FUNCTION ( SDB___PMDEDUCB_DUMPINFO, "_pmdEDUCB::dumpInfo" )
 void _pmdEDUCB::dumpInfo ( monEDUSimple &simple )
 {
    PD_TRACE_ENTRY ( SDB___PMDEDUCB_DUMPINFO );
    ossScopedLock _lock ( &_mutex, SHARED ) ;
    ossMemset ( &simple._eduStatus, 0, MON_EDU_STATUS_SZ ) ;
    ossMemset ( &simple._eduType, 0, MON_EDU_TYPE_SZ ) ;
    ossMemset ( &simple._eduName, 0, MON_EDU_NAME_SZ ) ;
    simple._eduID = _eduID ;
    simple._tid = _tid ;
    ossStrncpy ( simple._eduStatus, getEDUStatusDesp(_status),
                 MON_EDU_STATUS_SZ ) ;
    ossStrncpy ( simple._eduType, getEDUName (_eduType), MON_EDU_TYPE_SZ ) ;
    ossStrncpy ( simple._eduName, _Name, MON_EDU_NAME_SZ ) ;
    PD_TRACE_EXIT ( SDB___PMDEDUCB_DUMPINFO );
 }
コード例 #3
0
ファイル: pmdEDU.cpp プロジェクト: jasonsungblog/SequoiaDB
   // PD_TRACE_DECLARE_FUNCTION ( SDB___PMDEDUCB_DUMPINFO2, "_pmdEDUCB::dumpInfo" )
   void _pmdEDUCB::dumpInfo ( monEDUFull &full )
   {
      PD_TRACE_ENTRY ( SDB___PMDEDUCB_DUMPINFO2 );
      ossScopedLock _lock ( &_mutex, SHARED ) ;
      ossMemset ( &full._eduStatus, 0, MON_EDU_STATUS_SZ ) ;
      ossMemset ( &full._eduType, 0, MON_EDU_TYPE_SZ ) ;
      ossMemset ( &full._eduName, 0, MON_EDU_NAME_SZ ) ;
      full._eduID = _eduID ;
      full._tid = _tid ;
      full._processEventCount = _processEventCount ;
      full._queueSize = _queue.size() ;
      ossStrncpy ( full._eduStatus, getEDUStatusDesp(_status),
                   MON_EDU_STATUS_SZ ) ;
      ossStrncpy ( full._eduType, getEDUName (_eduType), MON_EDU_TYPE_SZ ) ;
      ossStrncpy ( full._eduName, _Name, MON_EDU_NAME_SZ ) ;

      full._monApplCB = _monApplCB ;
      full._threadHdl = _threadHdl ;

      full._eduContextList = _contextList ;
      PD_TRACE_EXIT ( SDB___PMDEDUCB_DUMPINFO2 );
   }
コード例 #4
0
// PD_TRACE_DECLARE_FUNCTION ( SDB_PMDCBMGREP, "pmdCBMgrEntryPoint" )
INT32 pmdCBMgrEntryPoint ( pmdEDUCB *cb, void *pData )
{
    INT32 rc = SDB_OK ;
    PD_TRACE_ENTRY ( SDB_PMDCBMGREP );

    _pmdObjBase *pObj = ( _pmdObjBase* )pData ;
    pmdEDUMgr *pEDUMgr = cb->getEDUMgr() ;
    pmdEDUEvent eventData;
    INT32 timeSpan = 0 ;
    INT32 maxMsgTime = pObj->getMaxProcMsgTime() ;
    INT32 maxEventTime = pObj->getMaxProcEventTime() ;
    INT32 *pMsgTimeSpan = maxMsgTime >= 0 ? &timeSpan : NULL ;
    INT32 *pEventTimeSpan = maxEventTime >= 0 ? &timeSpan : NULL ;

    pObj->attachCB( cb ) ;

    rc = pEDUMgr->activateEDU( cb->getID() ) ;
    if ( SDB_OK != rc )
    {
        PD_LOG ( PDERROR, "Failed to active EDU" ) ;
        goto error ;
    }

    while ( !cb->isDisconnected() )
    {
        if ( cb->waitEvent( eventData, OSS_ONE_SEC ) )
        {
            if ( PMD_EDU_EVENT_TERM == eventData._eventType )
            {
                PD_LOG ( PDDEBUG, "EDU[%lld, %s] is terminated", cb->getID(),
                         getEDUName( cb->getType() ) ) ;
            }
            else if ( PMD_EDU_EVENT_MSG == eventData._eventType )
            {
                pObj->dispatchMsg( (NET_HANDLE)eventData._userData,
                                   (MsgHeader*)(eventData._Data),
                                   pMsgTimeSpan ) ;
                if ( pMsgTimeSpan && timeSpan > maxMsgTime )
                {
                    MsgHeader *pMsg = (MsgHeader*)(eventData._Data) ;
                    PD_LOG( PDWARNING, "[%s] Process msg[opCode:[%d]%d, "
                            "requestID: %lld, TID: %d, Len: %d] over %d seconds",
                            pObj->name(), IS_REPLY_TYPE(pMsg->opCode),
                            GET_REQUEST_TYPE(pMsg->opCode), pMsg->requestID,
                            pMsg->TID, pMsg->messageLength, timeSpan ) ;
                }
            }
            else
            {
                pObj->dispatchEvent ( &eventData, pEventTimeSpan ) ;
                if ( pEventTimeSpan && timeSpan > maxEventTime )
                {
                    PD_LOG( PDWARNING, "[%s] Process event[type:%d] over %d "
                            "seconds", pObj->name(), eventData._eventType,
                            timeSpan ) ;
                }
            }

            pmdEduEventRelase( eventData, cb ) ;
            eventData.reset () ;
        }
    }

done:
    pObj->detachCB( cb ) ;
    PD_TRACE_EXITRC ( SDB_PMDCBMGREP, rc );
    return rc ;
error:
    goto done ;
}