本文整理汇总了C++中PD_RC_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ PD_RC_CHECK函数的具体用法?C++ PD_RC_CHECK怎么用?C++ PD_RC_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PD_RC_CHECK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setsockopt
int _ossSocket::bind_listen ()
{
int rc = EDB_OK ;
int temp = 1 ;
rc = setsockopt ( _fd, SOL_SOCKET,
SO_REUSEADDR, (char*)&temp, sizeof(int) ) ;
if ( rc )
{
PD_LOG ( PDWARNING, "Failed to setsockopt SO_REUSEADDR, rc = %d",
SOCKET_GETLASTERROR ) ;
}
rc = setSocketLi ( 1, 30 ) ;
if ( rc )
{
PD_LOG ( PDWARNING, "Failed to setsockopt SO_LINGER, rc = %d",
SOCKET_GETLASTERROR ) ;
}
rc = ::bind ( _fd, (struct sockaddr*)&_sockAddress, _addressLen ) ;
if ( rc )
{
PD_RC_CHECK( EDB_NETWORK, PDERROR,
"Failed to bind socket, rc = %d", SOCKET_GETLASTERROR ) ;
}
rc = listen ( _fd, SOMAXCONN ) ;
if ( rc )
{
PD_RC_CHECK( EDB_NETWORK, PDERROR,
"Failed to listen socket, rc = %d", SOCKET_GETLASTERROR ) ;
}
done :
return rc ;
error :
close () ;
goto done ;
}
开发者ID:nmred,项目名称:test_db,代码行数:35,代码来源:ossSocket.cpp
示例2: attachSHM
INT32 iPmdDMNChildProc::active()
{
INT32 rc = SDB_OK;
rc = attachSHM();
if ( SDB_OK == rc )
{
UINT32 i = 3;
UINT32 sn = _procInfo->sn;
while( i-- > 0 )
{
if ( sn != _procInfo->sn &&
(sn + 1) != _procInfo->sn )
{
rc = SDB_PERM;
PD_RC_CHECK( rc, PDERROR, "Don't repeat start the process" );
}
ossSleep( 2 * OSS_ONE_SEC ) ;
}
_procInfo->szTag[ 0 ] = 0 ;
_procInfo->init() ;
}
else
{
rc = allocSHM();
PD_RC_CHECK( rc, PDERROR, "Failed to allocate share-memory(rc=%d)",
rc ) ;
}
done:
return rc;
error:
detachSHM();
goto done;
}
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:33,代码来源:pmdDaemon.cpp
示例3: pmdModuleLoader
INT32 _pmdController::loadForeignModule()
{
INT32 rc = SDB_OK ;
const CHAR *MONGO_MODULE_NAME = "fapmongo" ;
const CHAR *MONGO_MODULE_PATH = "./bin/fap/" ;
_fapMongo = SDB_OSS_NEW pmdModuleLoader() ;
if ( NULL == _fapMongo )
{
PD_LOG( PDERROR, "Failed to alloc foreign access protocol module" ) ;
rc = SDB_OOM ;
goto error ;
}
rc = _fapMongo->load( MONGO_MODULE_NAME, MONGO_MODULE_PATH ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to load module: %s, path: %s"
" rc: %d", MONGO_MODULE_NAME, MONGO_MODULE_PATH, rc ) ;
rc = _fapMongo->create( _protocol ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to create protocol service" ) ;
rc = _protocol->init( pmdGetKRCB() ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to init protocol" ) ;
done:
return rc ;
error:
goto done ;
}
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:25,代码来源:pmdController.cpp
示例4: PD_RC_CHECK
INT32 aggrProjectParser::addField( const CHAR *pAlias, const CHAR *pPara,
const CHAR *pCLName, qgmOPFieldVec &selectorVec,
_qgmPtrTable *pTable )
{
INT32 rc = SDB_OK;
qgmField slValAttr;
qgmField slValRelegation;
qgmOpField selector;
rc = pTable->getOwnField( AGGR_CL_DEFAULT_ALIAS, slValRelegation );
PD_RC_CHECK( rc, PDERROR,
"failed to get the field(%s)",
AGGR_CL_DEFAULT_ALIAS );
rc = pTable->getOwnField( pPara, slValAttr );
PD_RC_CHECK( rc, PDERROR,
"failed to get the field(%s)",
pPara );
rc = pTable->getOwnField( pAlias, selector.alias );
PD_RC_CHECK( rc, PDERROR,
"failed to get the field(%s)",
pAlias );
{
qgmDbAttr slVal( slValRelegation, slValAttr );
selector.value = slVal;
selector.type = SQL_GRAMMAR::DBATTR;
selectorVec.push_back( selector );
}
done:
return rc;
error:
goto done;
}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:35,代码来源:aggrProject.cpp
示例5: pmdGetKRCB
INT32 rtnCoord2PhaseCommit::doPhase2( CHAR * pReceiveBuffer, SINT32 packSize,
CHAR * * ppResultBuffer, pmdEDUCB * cb,
MsgOpReply & replyHeader )
{
INT32 rc = SDB_OK;
pmdKRCB *pKrcb = pmdGetKRCB();
CoordCB *pCoordcb = pKrcb->getCoordCB();
netMultiRouteAgent *pRouteAgent = pCoordcb->getRouteAgent();
CHAR *pMsgReq = NULL;
MsgHeader *pMsgHead = NULL;
CoordGroupList groupLst;
CoordGroupList sendGroupLst;
rc = buildPhase2Msg( pReceiveBuffer, &pMsgReq );
PD_RC_CHECK( rc, PDERROR,
"failed to build the message on phase1(rc=%d)",
rc );
pMsgHead = (MsgHeader *)pMsgReq;
pMsgHead->TID = cb->getTID();
rc = executeOnDataGroup( pMsgReq, pRouteAgent, cb );
PD_RC_CHECK( rc, PDERROR,
"failed to execute on data-group on phase1(rc=%d)",
rc );
done:
if ( pMsgReq )
{
SDB_OSS_FREE( pMsgReq );
pMsgReq = NULL;
}
return rc;
error:
goto done;
}
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:35,代码来源:rtnCoordTransaction.cpp
示例6: PD_LOG
INT32 _utilESBulkActionBase::output( CHAR *buffer, INT32 size,
INT32 &length, BOOLEAN withIndex,
BOOLEAN withType, BOOLEAN withID ) const
{
INT32 rc = SDB_OK ;
INT32 metaLen = 0 ;
INT32 dataLen = 0 ;
if ( size < outSizeEstimate() )
{
rc = SDB_INVALIDARG ;
PD_LOG( PDERROR, "Buffer size[%d] is too small", size ) ;
goto error ;
}
rc = _outputActionAndMeta( buffer, size, metaLen,
withIndex, withType, withID ) ;
PD_RC_CHECK( rc, PDERROR, "Output action and metadata failed[ %d ]",
rc ) ;
if ( _hasSourceData() )
{
rc = _outputSrcData( buffer + metaLen, size - metaLen, dataLen ) ;
PD_RC_CHECK( rc, PDERROR, "Output source data failed[ %d ]", rc ) ;
}
length = metaLen + dataLen ;
done:
return rc ;
error:
goto done ;
}
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:33,代码来源:utilESBulkBuilder.cpp
示例7: buildPhase1Msg
INT32 rtnCoord2PhaseCommit::doPhase1( MsgHeader *pMsg,
pmdEDUCB *cb,
INT64 &contextID,
rtnContextBuf *buf )
{
INT32 rc = SDB_OK;
CHAR *pMsgReq = NULL;
rc = buildPhase1Msg( (CHAR*)pMsg, &pMsgReq );
PD_RC_CHECK( rc, PDERROR,
"Failed to build the message on phase1(rc=%d)",
rc );
// execute on data nodes
rc = executeOnDataGroup( (MsgHeader*)pMsgReq, cb, contextID, buf ) ;
PD_RC_CHECK( rc, PDERROR,
"Failed to execute on data-group on phase1(rc=%d)",
rc ) ;
done:
if ( pMsgReq )
{
SDB_OSS_FREE( pMsgReq );
pMsgReq = NULL;
}
return rc;
error:
goto done;
}
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:29,代码来源:rtnCoordTransaction.cpp
示例8: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU_UPDATECOLLECTIONATTRIBUTES, "_dmsStorageUnit::updateCollectionAttributes" )
INT32 _dmsStorageUnit::updateCollectionAttributes( const CHAR *pName,
UINT32 newAttributes,
dmsMBContext *context )
{
INT32 rc = SDB_OK ;
BOOLEAN getContext = FALSE ;
PD_TRACE_ENTRY ( SDB__DMSSU_UPDATECOLLECTIONATTRIBUTES ) ;
if ( NULL == context )
{
SDB_ASSERT( pName, "Collection name can't be NULL" ) ;
rc = _pDataSu->getMBContext( &context, pName, SHARED ) ;
PD_RC_CHECK( rc, PDERROR, "Get collection[%s] mb context failed, "
"rc: %d", pName, rc ) ;
getContext = TRUE ;
}
else if ( !context->isMBLock() )
{
rc = context->mbLock( SHARED ) ;
PD_RC_CHECK( rc, PDERROR, "Lock collection failed, rc: %d", rc ) ;
}
context->mb()->_attributes = newAttributes ;
done :
if ( getContext && context )
{
_pDataSu->releaseMBContext( context ) ;
}
PD_TRACE_EXITRC ( SDB__DMSSU_UPDATECOLLECTIONATTRIBUTES, rc ) ;
return rc ;
error :
goto done ;
}
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:36,代码来源:dmsStorageUnit.cpp
示例9: getError
int InsertCommand::execute( ossSocket & sock, std::vector<std::string> & argVec )
{
int rc = EDB_OK;
if( argVec.size() <1 )
{
return getError(EDB_INSERT_INVALID_ARGUMENT);
}
_jsonString = argVec[0];
if( !sock.isConnected() )
{
return getError(EDB_SOCK_NOT_CONNECT);
}
rc = sendOrder( sock, msgBuildInsert );
PD_RC_CHECK ( rc, PDERROR, "Failed to send order, rc = %d", rc ) ;
rc = recvReply( sock );
PD_RC_CHECK ( rc, PDERROR, "Failed to receive reply, rc = %d", rc ) ;
rc = handleReply();
PD_RC_CHECK ( rc, PDERROR, "Failed to receive reply, rc = %d", rc ) ;
done :
return rc;
error :
goto done ;
}
开发者ID:amaliujia,项目名称:StoneDB,代码行数:25,代码来源:command.cpp
示例10: SDB_ASSERT
INT32 _rtnCtxDataDispatcher::_processData ( INT64 processorType,
INT64 dataID,
const CHAR * data,
INT32 dataSize,
INT32 dataNum )
{
INT32 rc = SDB_OK ;
for ( rtnCtxDataProcessorList::iterator iter = _processors.begin() ;
iter != _processors.end() ;
iter ++ )
{
_IRtnCtxDataProcessor * processor = ( *iter ) ;
SDB_ASSERT( NULL != processor, "processor is invalid" ) ;
if ( processorType == (INT64)processor->getProcessType() )
{
rc = processor->processData( dataID, data, dataSize, dataNum ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to process data, rc: %d", rc ) ;
}
else if ( processor->needCheckData() )
{
rc = processor->checkData( dataID, data, dataSize, dataNum ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to check data, rc: %d", rc ) ;
}
}
done :
return rc ;
error :
goto done ;
}
开发者ID:SequoiaDB,项目名称:SequoiaDB,代码行数:34,代码来源:rtnContextDataDispatcher.cpp
示例11: pmdGetKRCB
INT32 _pmdController::activeForeignModule()
{
INT32 rc = SDB_OK ;
pmdEDUParam *pProtocolData = NULL ;
pmdEDUMgr *pEDUMgr = pmdGetKRCB()->getEDUMgr() ;
EDUID eduID = PMD_INVALID_EDUID ;
if ( NULL == _fapMongo )
{
goto done ;
}
// listener for access protocol
pProtocolData = new pmdEDUParam() ;
pProtocolData->pSocket = (void *)_pMongoListener ;
pProtocolData->protocol = _protocol ;
rc = pEDUMgr->startEDU( EDU_TYPE_FAPLISTENER, (void*)pProtocolData,
&eduID ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to start FAP listerner, rc: %d",
rc ) ;
pEDUMgr->regSystemEDU( EDU_TYPE_FAPLISTENER, eduID ) ;
// wait until protocol listener starts
rc = pEDUMgr->waitUntil ( eduID, PMD_EDU_RUNNING ) ;
PD_RC_CHECK( rc, PDERROR, "Wait FAP Listener active failed, rc: %d",
rc ) ;
done:
return rc ;
error:
goto done ;
}
开发者ID:Andrew8305,项目名称:SequoiaDB,代码行数:32,代码来源:pmdController.cpp
示例12: pmdMasterThreadMain
int pmdMasterThreadMain(int argc, char **argv)
{
int rc = EDB_OK;
EDB_KRCB *krcb = pmdGetKRCB();
pmdEDUMgr* eduMgr = krcb->getEDUMgr();
EDUID agentEDU = PMD_INVALID_EDUID;
rc = pmdSetupSignalHandler();
PD_RC_CHECK(rc, PDERROR, "Failed to setup signal handler, rc = %d", rc);
rc = pmdResolveArguments(argc, argv);
if (EDB_PMD_HELP_ONLY == rc) {
goto done;
}
PD_RC_CHECK(rc, PDERROR, "Failed to resolve argument, rc = %d", rc);
rc = eduMgr->startEDU(EDU_TYPE_TCPLISTENER, NULL, &agentEDU);
PD_RC_CHECK ( rc, PDERROR, "Failed to start tcplistener edu, rc = %d", rc ) ;
while(EDB_IS_DB_UP) {
sleep(1);
}
eduMgr->reset();
done:
return rc;
error:
goto done;
}
开发者ID:nmred,项目名称:test_db,代码行数:28,代码来源:pmdMain.cpp
示例13: SDB_ASSERT
// PD_TRACE_DECLARE_FUNCTION ( SDB_DPSTRANSLOCK_TRYUPGRADE, "dpsTransLock::tryUpgrade" )
INT32 dpsTransLock::tryUpgrade( _pmdEDUCB *eduCB,
const dpsTransLockId &lockId,
dpsTransCBLockInfo *pLockInfo,
DPS_TRANSLOCK_TYPE lockType )
{
SDB_ASSERT( eduCB, "eduCB can't be null" ) ;
INT32 rc = SDB_OK;
DPS_TRANSLOCK_TYPE lastLockType;
dpsLockBucket *pLockBucket = NULL;
rc = upgradeCheck( pLockInfo->getType(), lockType );
PD_RC_CHECK( rc, PDERROR, "Upgrade lock failed(rc=%d)", rc );
rc = getBucket( lockId, pLockBucket );
PD_RC_CHECK( rc, PDERROR, "Failed to get lock-bucket, upgrade lock "
"failed(rc=%d)", rc );
lastLockType = pLockInfo->getType();
pLockInfo->setType( lockType );
rc = pLockBucket->tryAcquire( eduCB, lockId, lockType );
PD_CHECK( SDB_OK == rc, rc, rollbackType, PDERROR,
"Upgrade lock failed(rc=%d)", rc );
done:
PD_TRACE_EXIT ( SDB_DPSTRANSLOCK_TRYUPGRADE );
return rc;
rollbackType:
pLockInfo->setType( lastLockType );
error:
goto done;
}
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:32,代码来源:dpsTransLock.cpp
示例14: PD_RC_CHECK
int _ossSocket::connect ()
{
int rc = EDB_OK ;
rc = ::connect ( _fd, (struct sockaddr *)&_sockAddress, _addressLen ) ;
if ( rc )
{
PD_RC_CHECK ( EDB_NETWORK, PDERROR,
"Failed to connect, rc = %d", SOCKET_GETLASTERROR ) ;
}
rc = getsockname ( _fd, (sockaddr*)&_sockAddress, &_addressLen ) ;
if ( rc )
{
PD_RC_CHECK ( EDB_NETWORK, PDERROR,
"Failed to get local address, rc = %d", rc ) ;
}
// get peer address
rc = getpeername ( _fd, (sockaddr*)&_peerAddress, &_peerAddressLen ) ;
if ( rc )
{
PD_RC_CHECK ( EDB_NETWORK, PDERROR,
"Failed to get peer address, rc = %d", rc ) ;
}
done :
return rc ;
error :
goto done ;
}
开发者ID:nmred,项目名称:test_db,代码行数:27,代码来源:ossSocket.cpp
示例15: _checkDstGroupInCSDomain
static INT32 _checkDstGroupInCSDomain( const CHAR * groupName,
const CHAR * clFullName,
BOOLEAN & existed,
pmdEDUCB *cb )
{
INT32 rc = SDB_OK ;
CHAR szSpace [ DMS_COLLECTION_SPACE_NAME_SZ + 1 ] = {0} ;
CHAR szCollection [ DMS_COLLECTION_NAME_SZ + 1 ] = {0} ;
existed = FALSE ;
BSONObj csObj ;
BOOLEAN csExist = FALSE ;
const CHAR *domainName = NULL ;
rc = catResolveCollectionName( clFullName, ossStrlen( clFullName ),
szSpace, DMS_COLLECTION_SPACE_NAME_SZ,
szCollection, DMS_COLLECTION_NAME_SZ ) ;
PD_RC_CHECK( rc, PDERROR, "Resolve collection name[%s] failed, rc: %d",
clFullName, rc ) ;
rc = catCheckSpaceExist( szSpace, csExist, csObj, cb ) ;
PD_RC_CHECK( rc, PDWARNING, "Check collection space[%s] exist failed, "
"rc: %d", szSpace, rc ) ;
PD_CHECK( csExist, SDB_DMS_CS_NOTEXIST, error, PDWARNING,
"Collection space[%s] is not exist", szSpace ) ;
rc = rtnGetStringElement( csObj, CAT_DOMAIN_NAME, &domainName ) ;
if ( SDB_FIELD_NOT_EXIST == rc )
{
existed = TRUE ;
rc = SDB_OK ;
goto done ;
}
else if ( SDB_OK == rc )
{
BSONObj domainObj ;
map<string, INT32> groups ;
rc = catGetDomainObj( domainName, domainObj, cb ) ;
PD_RC_CHECK( rc, PDERROR, "Get domain[%s] failed, rc: %d",
domainName, rc ) ;
rc = catGetDomainGroups( domainObj, groups ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to get groups from domain info[%s], "
"rc: %d", domainObj.toString().c_str(), rc ) ;
if ( groups.find( groupName ) != groups.end() )
{
existed = TRUE ;
}
}
done:
return rc ;
error:
goto done ;
}
开发者ID:jasonsungblog,项目名称:SequoiaDB,代码行数:58,代码来源:catSplit.cpp
示例16: while
int _ossSocket::accept ( SOCKET *sock, struct sockaddr *addr, socklen_t *addrlen,
int timeout )
{
int rc = EDB_OK ;
int maxFD = (int)_fd ;
struct timeval maxSelectTime ;
fd_set fds ;
maxSelectTime.tv_sec = timeout / 1000000 ;
maxSelectTime.tv_usec = timeout % 1000000 ;
while ( true )
{
FD_ZERO ( &fds ) ;
FD_SET ( _fd, &fds ) ;
rc = select ( maxFD + 1, &fds, NULL, NULL,
timeout>=0?&maxSelectTime:NULL ) ;
// 0 means timeout
if ( 0 == rc )
{
*sock = 0 ;
rc = EDB_TIMEOUT ;
goto done ;
}
// if < 0, means something wrong
if ( 0 > rc )
{
rc = SOCKET_GETLASTERROR ;
// if we failed due to interrupt, let's continue
if ( OSS_EINTR == rc )
{
continue ;
}
PD_RC_CHECK ( EDB_NETWORK, PDERROR,
"Failed to select from socket, rc = %d",
SOCKET_GETLASTERROR);
}
// if the socket we interested is not receiving anything, let's continue
if ( FD_ISSET ( _fd, &fds ) )
{
break ;
}
}
rc = EDB_OK ;
*sock = ::accept ( _fd, addr, addrlen );
if ( -1 == *sock )
{
PD_RC_CHECK ( EDB_NETWORK, PDERROR,
"Failed to accept socket, rc = %d",
SOCKET_GETLASTERROR ) ;
}
done :
return rc ;
error :
close () ;
goto done ;
}
开发者ID:nmred,项目名称:test_db,代码行数:58,代码来源:ossSocket.cpp
示例17: while
int _ossSocket::recvNF(char *pMsg, int len, int timeout) {
int rc = EDB_OK;
int maxFD = _fd;
struct timeval maxSelectTime;
fd_set fds;
if (len == 0) {
return EDB_OK;
}
maxSelectTime.tv_sec = timeout / 1000000;
maxSelectTime.tv_usec = timeout % 1000000;
while (1) {
FD_ZERO(&fds);
FD_SET(_fd, &fds);
rc = select(maxFD+1, &fds, NULL, NULL,
timeout>=0?&maxSelectTime:NULL);
// 0 means timeout
if (rc == 0) {
rc = EDB_TIMEOUT;
goto done;
}
if (rc < 0) {
rc = SOCKET_GETLASTERROR;
if (rc == EINTR) {
continue;
}
PD_RC_CHECK(EDB_NETWORK, PDERROR, "Failed to select from socket, rc = %d", rc);
}
if (FD_ISSET(_fd, &fds)) {
break;
}
}
rc = ::recv(_fd, pMsg, len, MSG_NOSIGNAL);
if (rc > 0) {
len = rc;
} else if (rc == 0) {
PD_RC_CHECK(EDB_NETWORK, PDERROR, "Peer unexpected shutdown");
} else {
rc = SOCKET_GETLASTERROR;
if ((rc == EAGAIN || rc == EWOULDBLOCK) && _timeout > 0) {
PD_RC_CHECK(EDB_NETWORK, PDERROR, "Recv() timeout: rc = %d", rc);
} else if (rc == EINTR) {
// do nothing
} else {
PD_RC_CHECK(EDB_NETWORK, PDERROR, "Recv() Failed: rc = %d", rc);
}
}
rc = EDB_OK;
done:
return rc;
error:
goto done;
}
开发者ID:senarukana,项目名称:emeralddb,代码行数:56,代码来源:ossSocket.cpp
示例18: while
INT32 rtnCoordTransCommit::executeOnDataGroup( CHAR * pMsg,
netMultiRouteAgent * pRouteAgent,
pmdEDUCB * cb )
{
INT32 rc = SDB_OK;
REQUESTID_MAP requestIdMap;
REPLY_QUE replyQue;
MsgHeader *pMsgHead = (MsgHeader *)pMsg;
DpsTransNodeMap *pNodeMap = cb->getTransNodeLst();
DpsTransNodeMap::iterator iterMap = pNodeMap->begin();
while( iterMap != pNodeMap->end() )
{
rc = rtnCoordSendRequestToNode( (void *)pMsg, iterMap->second,
pRouteAgent, cb, requestIdMap );
if ( rc )
{
rtnCoordClearRequest( cb, requestIdMap );
}
PD_RC_CHECK( rc, PDERROR,
"failed to send the request to the node"
"(groupID=%u, nodeID=%u, rc=%d). ",
iterMap->second.columns.groupID,
iterMap->second.columns.nodeID,
rc );
++iterMap;
}
rc = rtnCoordGetReply( cb, requestIdMap, replyQue,
MAKE_REPLY_TYPE( pMsgHead->opCode ) ) ;
PD_RC_CHECK( rc, PDERROR,
"failed to get the reply(rc=%d)",
rc );
while ( !replyQue.empty() )
{
MsgOpReply *pReply = NULL;
pReply = (MsgOpReply *)(replyQue.front());
replyQue.pop();
INT32 rcTmp = pReply->flags;
if ( rcTmp != SDB_OK )
{
rc = rc ? rc : rcTmp;
PD_LOG( PDERROR,
"failed to execute on data node(rc=%d, groupID=%u, nodeID=%u)",
rcTmp, pReply->header.routeID.columns.groupID,
pReply->header.routeID.columns.nodeID );
}
SDB_OSS_FREE( pReply );
}
if ( rc )
{
goto error;
}
done:
return rc;
error:
goto done;
}
开发者ID:ArvinPatrick,项目名称:SequoiaDB,代码行数:56,代码来源:rtnCoordTransaction.cpp
示例19: iter
INT32 aggrSortParser::buildOrderBy( const BSONElement &elem,
qgmOPFieldVec &orderBy,
_qgmPtrTable *pTable,
const CHAR *pCLName )
{
INT32 rc = SDB_OK;
try
{
BSONObj obj = elem.embeddedObject();
BSONObjIterator iter( obj );
while ( iter.more() )
{
BSONElement beField = iter.next();
PD_CHECK( beField.isNumber(), SDB_INVALIDARG, error, PDERROR,
"type of sort-field must be number!" );
{
qgmField obValAttr;
qgmField obValRelegation;
rc = pTable->getOwnField( AGGR_CL_DEFAULT_ALIAS,
obValRelegation );
PD_RC_CHECK( rc, PDERROR, "failed to get the field(%s)",
AGGR_CL_DEFAULT_ALIAS );
rc = pTable->getOwnField( beField.fieldName(), obValAttr );
PD_RC_CHECK( rc, PDERROR, "failed to get the field(%s)",
beField.fieldName() );
{
qgmDbAttr obVal( obValRelegation, obValAttr );
qgmField obAlias;
qgmOpField obOpField;
obOpField.value = obVal;
obOpField.alias = obAlias;
if ( beField.number() > 0 )
{
obOpField.type = SQL_GRAMMAR::ASC;
}
else
{
obOpField.type = SQL_GRAMMAR::DESC;
}
orderBy.push_back( obOpField );
}
}
}
}
catch ( std::exception &e )
{
PD_CHECK( SDB_INVALIDARG, SDB_INVALIDARG, error, PDERROR,
"failed to parse the \"sort\", received unexpected error:%s",
e.what() );
}
done:
return rc;
error:
goto done;
}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:55,代码来源:aggrSort.cpp
示例20: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION ( SDB_RTNCOINS_INSTOGROUP, "rtnCoordInsert::insertToAGroup" )
INT32 rtnCoordInsert::insertToAGroup( CHAR *pBuffer,
UINT32 grpID,
netMultiRouteAgent *pRouteAgent,
pmdEDUCB *cb )
{
INT32 rc = SDB_OK;
PD_TRACE_ENTRY ( SDB_RTNCOINS_INSTOGROUP ) ;
BOOLEAN isNeedRetry = FALSE;
BOOLEAN hasRetry = FALSE;
CoordGroupList groupLst;
CoordGroupList successGroupLst;
groupLst[grpID] = grpID;
MsgHeader *pHead = (MsgHeader *)pBuffer ;
if ( cb->isTransaction() )
{
pHead->opCode = MSG_BS_TRANS_INSERT_REQ;
}
do
{
hasRetry = isNeedRetry;
isNeedRetry = FALSE;
REQUESTID_MAP sendNodes;
rc = rtnCoordSendRequestToNodeGroups( pBuffer, groupLst, TRUE,
pRouteAgent, cb, sendNodes );
if ( rc )
{
rtnCoordClearRequest( cb, sendNodes );
}
PD_RC_CHECK( rc, PDERROR, "Failed to insert on data-node, "
"send request failed(rc=%d)", rc ) ;
REPLY_QUE replyQue;
rc = rtnCoordGetReply( cb, sendNodes, replyQue,
MAKE_REPLY_TYPE( pHead->opCode ) );
PD_RC_CHECK( rc, PDWARNING, "Failed to insert on data-node, "
"get reply failed(rc=%d)", rc );
rc = processReply( replyQue, successGroupLst, cb );
if ( SDB_CLS_NOT_PRIMARY == rc && !hasRetry )
{
isNeedRetry = TRUE;
rc = SDB_OK;
}
PD_RC_CHECK( rc, PDWARNING, "Failed to process the reply(rc=%d)",
rc );
} while ( isNeedRetry );
done:
PD_TRACE_EXITRC ( SDB_RTNCOINS_INSTOGROUP, rc ) ;
return rc;
error:
goto done;
}
开发者ID:Niwalker,项目名称:SequoiaDB,代码行数:55,代码来源:rtnCoordInsert.cpp
注:本文中的PD_RC_CHECK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论