本文整理汇总了C++中SDB_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ SDB_ASSERT函数的具体用法?C++ SDB_ASSERT怎么用?C++ SDB_ASSERT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDB_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOption
INT32 getOption( CHAR **optAddr, UINT32 *optSize = NULL ) const
{
INT32 rc = SDB_OK ;
SDB_ASSERT( optAddr, "Option buffer is NULL" ) ;
if ( 0 == _optSize )
{
rc = SDB_SYS ;
goto error ;
}
*optAddr = (CHAR *)this + sizeof(_dmsOptExtent) ;
if ( optSize )
{
*optSize = _optSize ;
}
done:
return rc ;
error:
goto done ;
}
示例2: qgmDump
INT32 qgmDump ( _qgmPlanContainer *op, CHAR *pBuffer, INT32 bufferSize )
{
INT32 rc = SDB_OK ;
INT32 id = 0 ;
SDB_ASSERT ( op && pBuffer, "op and pBuffer can't be NULL" ) ;
_qgmOperatorElement rootElement ;
rc = qgmCalcElement ( op->plan(), &rootElement, id, 0 ) ;
PD_RC_CHECK ( rc, PDERROR, "Failed to calc element, rc = %d", rc ) ;
rc = qgmAssignPos ( &rootElement, 0 ) ;
PD_RC_CHECK ( rc, PDERROR, "Failed to assign pos, rc = %d", rc ) ;
rc = qgmPrint ( &rootElement, pBuffer, bufferSize ) ;
PD_RC_CHECK ( rc, PDERROR, "Failed to print, rc = %d", rc ) ;
id = 0 ;
rc = qgmDumpDetails ( op->plan(), pBuffer, bufferSize, id ) ;
PD_RC_CHECK ( rc, PDERROR, "Failed to dump details, rc = %d", rc ) ;
done :
return rc ;
error :
goto done ;
}
示例3: utilStrJoin
INT32 utilStrJoin( const CHAR **src,
UINT32 cnt,
CHAR *join,
UINT32 &joinSize )
{
SDB_ASSERT( NULL != join, "impossible" ) ;
INT32 rc = SDB_OK ;
UINT32 len = 0 ;
for ( UINT32 i = 0; i < cnt; i++ )
{
if ( NULL != src[i] )
{
UINT32 sLen = ossStrlen(src[i]) ;
ossMemcpy( join + len, src[i], sLen ) ;
len += sLen ;
}
}
joinSize = len ;
return rc ;
}
示例4: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION ( SDB__DMSSU__RESETCOLLECTION, "_dmsStorageUnit::_resetCollection" )
INT32 _dmsStorageUnit::_resetCollection( dmsMBContext *context )
{
INT32 rc = SDB_OK ;
PD_TRACE_ENTRY ( SDB__DMSSU__RESETCOLLECTION ) ;
SDB_ASSERT( context, "context can't be NULL" ) ;
rc = _pIndexSu->dropAllIndexes( context, NULL, NULL ) ;
if ( rc )
{
PD_LOG( PDERROR, "Drop all indexes failed, rc: %d", rc ) ;
}
rc = _pDataSu->_truncateCollection( context ) ;
if ( rc )
{
PD_LOG( PDERROR, "Truncate collection data failed, rc: %d", rc ) ;
}
PD_TRACE_EXITRC ( SDB__DMSSU__RESETCOLLECTION, rc ) ;
return rc ;
}
示例5: SDB_ASSERT
void dmsStorageLoadOp::_initExtentHeader ( dmsExtent *extAddr,
UINT16 numPages )
{
SDB_ASSERT ( _pageSize * numPages == _currentExtentSize,
"extent size doesn't match" ) ;
extAddr->_eyeCatcher[0] = DMS_EXTENT_EYECATCHER0 ;
extAddr->_eyeCatcher[1] = DMS_EXTENT_EYECATCHER1 ;
extAddr->_blockSize = numPages ;
extAddr->_mbID = 0 ;
extAddr->_flag = DMS_EXTENT_FLAG_INUSE ;
extAddr->_version = DMS_EXTENT_CURRENT_V ;
extAddr->_logicID = DMS_INVALID_EXTENT ;
extAddr->_prevExtent = DMS_INVALID_EXTENT ;
extAddr->_nextExtent = DMS_INVALID_EXTENT ;
extAddr->_recCount = 0 ;
extAddr->_firstRecordOffset = DMS_INVALID_EXTENT ;
extAddr->_lastRecordOffset = DMS_INVALID_EXTENT ;
extAddr->_freeSpace = _pageSize * numPages -
sizeof(dmsExtent) ;
}
示例6: PD_TRACE_ENTRY
INT32 migMaster::sendMsgToClient ( const CHAR *format, ... )
{
INT32 rc = SDB_OK ;
PD_TRACE_ENTRY ( SDB__MIGLOADJSONPS__SENDMSG );
SDB_ASSERT ( _sock, "_sock is NULL" ) ;
va_list ap;
pmdEDUCB *eduCB = pmdGetKRCB()->getEDUMgr()->getEDU() ;
CHAR buffer[ PD_LOG_STRINGMAX ] ;
boost::unique_lock<boost::mutex> lock ( _mutex ) ;
ossMemset ( buffer, 0, PD_LOG_STRINGMAX ) ;
va_start(ap, format) ;
vsnprintf(buffer, PD_LOG_STRINGMAX, format, ap) ;
va_end(ap) ;
if ( _sendMsg )
{
ossMemset ( _sendMsg, 0, _sendSize ) ;
}
rc = msgBuildMsgMsg ( &_sendMsg, &_sendSize,
0, buffer ) ;
if ( rc )
{
PD_LOG ( PDERROR, "Failed to msgBuildMsgMsg" ) ;
goto error ;
}
rc = pmdSend ( _sendMsg, *(INT32 *)_sendMsg,
_sock, eduCB ) ;
if ( rc )
{
PD_LOG ( PDERROR, "Failed to send buff, rc=%d", rc ) ;
goto error ;
}
done:
PD_TRACE_EXITRC ( SDB__MIGLOADJSONPS__SENDMSG, rc );
return rc ;
error:
goto done ;
}
示例7: PD_TRACE_ENTRY
///PD_TRACE_DECLARE_FUNCTION ( SDB__MTHINCLUDEPARSER_PARSE, "_mthIncludeParser::parse" )
INT32 _mthIncludeParser::parse( const bson::BSONElement &e,
_mthSAction &action ) const
{
INT32 rc = SDB_OK ;
PD_TRACE_ENTRY( SDB__MTHINCLUDEPARSER_PARSE ) ;
SDB_ASSERT( !e.eoo(), "can not be eoo" ) ;
if ( !e.isNumber() )
{
PD_LOG( PDERROR, "invalid element type[%d]", e.type() ) ;
rc = SDB_INVALIDARG ;
goto error ;
}
#if defined (_DEBUG)
if ( 0 != _name.compare( e.fieldName() ) )
{
PD_LOG( PDERROR, "field name[%s] is not valid",
e.fieldName() ) ;
rc = SDB_INVALIDARG ;
goto error ;
}
#endif
action.setName( _name.c_str() ) ;
if ( 0 == e.numberLong() )
{
action.setAttribute( MTH_S_ATTR_EXCLUDE ) ;
}
else
{
action.setAttribute( MTH_S_ATTR_INCLUDE ) ;
action.setFunc( &mthIncludeBuild,
&mthIncludeGet ) ;
}
done:
PD_TRACE_EXITRC( SDB__MTHINCLUDEPARSER_PARSE, rc ) ;
return rc ;
error:
goto done ;
}
示例8: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION( SDB__QGMCONDITIONNODEHELPER_SEPARATE2, "_qgmConditionNodeHelper::_separate2" )
void _qgmConditionNodeHelper::_separate( _qgmConditionNode *predicate,
qgmConditionNodePtrVec &nodes )
{
PD_TRACE_ENTRY( SDB__QGMCONDITIONNODEHELPER_SEPARATE2 ) ;
SDB_ASSERT( NULL != predicate, "predicate can't be NULL" ) ;
if ( SQL_GRAMMAR::AND == predicate->type )
{
_separate( predicate->left, nodes ) ;
_separate( predicate->right, nodes ) ;
predicate->dettach() ;
SAFE_OSS_DELETE( predicate ) ;
}
else if ( predicate )
{
nodes.push_back( predicate ) ;
}
PD_TRACE_EXIT( SDB__QGMCONDITIONNODEHELPER_SEPARATE2 ) ;
}
示例9: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION ( SDB_OSSSK_SETSKLI, "ossSocket::setSocketLi" )
INT32 _ossSocket::setSocketLi ( INT32 lOnOff, INT32 linger )
{
INT32 rc = SDB_OK ;
PD_TRACE_ENTRY ( SDB_OSSSK_SETSKLI );
SDB_ASSERT ( _init, "socket is not initialized" ) ;
struct linger _linger ;
_linger.l_onoff = lOnOff ;
_linger.l_linger = linger ;
PD_CHECK( _init, SDB_SYS, error, PDWARNING, "Socket is not init" ) ;
rc = setsockopt ( _fd, SOL_SOCKET, SO_LINGER,
(const char*)&_linger, sizeof (_linger) ) ;
done:
PD_TRACE_EXITRC ( SDB_OSSSK_SETSKLI, rc );
return rc ;
error:
goto done ;
}
示例10: SDB_ASSERT
void *_pmdEDUCB::getAlignedMemory( UINT32 alignment, UINT32 size )
{
SDB_ASSERT( alignment == OSS_FILE_DIRECT_IO_ALIGNMENT,
"rewrite this function if u want to use new alignment" ) ;
if ( _alignedMemSize < size )
{
if ( NULL != _alignedMem )
{
SDB_OSS_ORIGINAL_FREE( _alignedMem ) ;
_alignedMemSize = 0 ;
_alignedMem = NULL ;
}
_alignedMem = ossAlignedAlloc( alignment, size ) ;
if ( NULL != _alignedMem )
{
_alignedMemSize = size ;
}
}
return _alignedMem ;
}
示例11: PD_TRACE_ENTRY
INT32 _qgmPlNLJoin::_modifyInnerCondition( BSONObj &obj )
{
PD_TRACE_ENTRY( SDB__QGMPLNLJOIN__MODIFYINNERCONDITION ) ;
SDB_ASSERT( NULL != _param, "impossible" ) ;
INT32 rc = SDB_OK ;
QGM_VARLIST::const_iterator itr = _varlist.begin() ;
for ( ; itr != _varlist.end(); itr++ )
{
rc = _param->setVar( *itr, obj ) ;
if ( SDB_OK != rc )
{
goto error ;
}
}
done:
PD_TRACE_EXITRC( SDB__QGMPLNLJOIN__MODIFYINNERCONDITION, rc ) ;
return rc ;
error:
goto done ;
}
示例12: SDB_ASSERT
// PD_TRACE_DECLARE_FUNCTION ( SDB__IXMINXCB_GETKEY, "_ixmIndexCB::getKeysFromObject" )
INT32 _ixmIndexCB::getKeysFromObject ( const BSONObj &obj,
BSONObjSet &keys ) const
{
INT32 rc = SDB_OK ;
SDB_ASSERT ( _isInitialized,
"index details must be initialized first" ) ;
PD_TRACE_ENTRY ( SDB__IXMINXCB_GETKEY );
ixmIndexKeyGen keyGen(this) ;
rc = keyGen.getKeys ( obj, keys ) ;
if ( rc )
{
PD_LOG ( PDERROR, "Failed to generate key from object, rc: %d", rc ) ;
goto error ;
}
done :
PD_TRACE_EXITRC ( SDB__IXMINXCB_GETKEY, rc );
return rc ;
error :
goto done ;
}
示例13: PD_TRACE_ENTRY
// PD_TRACE_DECLARE_FUNCTION ( SDB__CLSREPSET_UNREGSN, "_clsReplicateSet::unregSession" )
void _clsReplicateSet::unregSession ( _clsDataSrcBaseSession * pSession )
{
PD_TRACE_ENTRY ( SDB__CLSREPSET_UNREGSN );
SDB_ASSERT ( pSession, "Session can't be null" ) ;
_vecLatch.lock_w () ;
std::vector<_clsDataSrcBaseSession*>::iterator it =
_vecSrcSessions.begin() ;
while ( it != _vecSrcSessions.end() )
{
if ( *it == pSession )
{
_vecSrcSessions.erase ( it ) ;
_srcSessionNum-- ;
break ;
}
++it ;
}
_vecLatch.release_w () ;
PD_TRACE_EXIT ( SDB__CLSREPSET_UNREGSN );
}
示例14: PD_TRACE_ENTRY
INT32 _qgmPlScan::_executeOnCoord( _pmdEDUCB *eduCB )
{
PD_TRACE_ENTRY( SDB__QGMPLSCAN__EXECONCOORD ) ;
INT32 rc = SDB_OK ;
INT32 bufSize = 0 ;
CHAR *qMsg = NULL ;
MsgOpReply dummyReply ;
BSONObj *err = NULL ;
BSONObj selector = _selector.selector() ;
rc = msgBuildQueryMsg ( &qMsg, &bufSize,
_collection.toString().c_str(),0,
0, _skip, _return,
&_condition, &selector,
&_orderby, &_hint ) ;
if ( SDB_OK != rc )
{
goto error ;
}
rc = _coordQuery.execute ( qMsg, *(SINT32*)qMsg, eduCB,
dummyReply, NULL ) ;
SDB_ASSERT( NULL == err, "impossible" ) ;
PD_RC_CHECK ( rc, PDERROR,
"Failed to execute coordQuery, rc = %d", rc ) ;
_contextID = dummyReply.contextID ;
done:
if ( NULL != qMsg )
{
SDB_OSS_FREE( qMsg ) ;
qMsg = NULL ;
}
PD_TRACE_EXITRC( SDB__QGMPLSCAN__EXECONCOORD, rc ) ;
return rc ;
error:
goto done ;
}
示例15: SDB_ASSERT
INT32 _coordCMDEval::_buildContext( _spdSession *session,
pmdEDUCB *cb,
SINT64 &contextID )
{
INT32 rc = SDB_OK ;
const BSONObj &evalRes = session->getRetMsg() ;
SDB_ASSERT( !evalRes.isEmpty(), "impossible" ) ;
SDB_RTNCB *rtnCB = pmdGetKRCB()->getRTNCB() ;
rtnContextSP *context = NULL ;
rc = rtnCB->contextNew ( RTN_CONTEXT_SP, (rtnContext**)&context,
contextID, cb ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to create new context, rc: %d", rc ) ;
rc = context->open( session ) ;
PD_RC_CHECK( rc, PDERROR, "Failed to open context[%lld], rc: %d",
context->contextID(), rc ) ;
done:
return rc ;
error:
goto done ;
}