UINT32 okSize() const { return _pOkRC ? (UINT32)_pOkRC->size() : 0 ; }
UINT32 ignoreSize() const { return _pIgnoreRC ? (UINT32)_pIgnoreRC->size() : 0 ; }
UINT32 nokSize() const { return _pNokRC ? (UINT32)_pNokRC->size() : 0 ; }
//PD_TRACE_DECLARE_FUNCTION ( COORD_OPERATORDEL_EXE, "_coordDeleteOperator::execute" ) INT32 _coordDeleteOperator::execute( MsgHeader *pMsg, pmdEDUCB *cb, INT64 &contextID, rtnContextBuf *buf ) { INT32 rc = SDB_OK ; INT32 rcTmp = SDB_OK ; PD_TRACE_ENTRY ( COORD_OPERATORDEL_EXE ) ; coordSendOptions sendOpt( TRUE ) ; coordSendMsgIn inMsg( pMsg ) ; coordProcessResult result ; ROUTE_RC_MAP nokRC ; result._pNokRC = &nokRC ; coordCataSel cataSel ; MsgRouteID errNodeID ; BSONObj boDeletor ; MsgOpDelete *pDelMsg = (MsgOpDelete *)pMsg ; INT32 oldFlag = pDelMsg->flags ; pDelMsg->flags |= FLG_DELETE_RETURNNUM ; contextID = -1 ; INT32 flag = 0; CHAR *pCollectionName = NULL ; CHAR *pDeletor = NULL ; CHAR *pHint = NULL ; rc = msgExtractDelete( (CHAR*)pMsg, &flag, &pCollectionName, &pDeletor, &pHint ) ; if( rc ) { PD_LOG( PDERROR,"Failed to parse delete request, rc: %d", rc ) ; pCollectionName = NULL ; goto error ; } try { boDeletor = BSONObj( pDeletor ) ; } catch ( std::exception &e ) { PD_RC_CHECK( SDB_INVALIDARG, PDERROR, "Delete failed, received unexpected error: %s", e.what() ) ; } MON_SAVE_OP_DETAIL( cb->getMonAppCB(), pMsg->opCode, "Collection:%s, Deletor:%s, Hint:%s, " "Flag:0x%08x(%u)", pCollectionName, boDeletor.toString().c_str(), BSONObj(pHint).toString().c_str(), oldFlag, oldFlag ) ; rc = cataSel.bind( _pResource, pCollectionName, cb, FALSE, TRUE ) ; if ( rc ) { PD_LOG( PDERROR, "Get or update collection[%s]'s catalog info " "failed, rc: %d", pCollectionName, rc ) ; goto error ; } retry: pDelMsg->version = cataSel.getCataPtr()->getVersion() ; pDelMsg->w = 0 ; rcTmp = doOpOnCL( cataSel, boDeletor, inMsg, sendOpt, cb, result ) ; if ( SDB_OK == rcTmp && nokRC.empty() ) { goto done ; } else if ( checkRetryForCLOpr( rcTmp, &nokRC, cataSel, inMsg.msg(), cb, rc, &errNodeID, TRUE ) ) { nokRC.clear() ; _groupSession.getGroupCtrl()->incRetry() ; goto retry ; } else { PD_LOG( PDERROR, "Delete failed on node[%s], rc: %d", routeID2String( errNodeID ).c_str(), rc ) ; goto error ; } done: if ( oldFlag & FLG_DELETE_RETURNNUM ) { contextID = _recvNum ; } if ( pCollectionName ) { PD_AUDIT_OP( AUDIT_DML, MSG_BS_DELETE_REQ, AUDIT_OBJ_CL, pCollectionName, rc, "DeletedNum:%u, Deletor:%s, Hint:%s, Flag:0x%08x(%u)", _recvNum, boDeletor.toString().c_str(), BSONObj(pHint).toString().c_str(), oldFlag, oldFlag ) ; } PD_TRACE_EXITRC ( COORD_OPERATORDEL_EXE, rc ) ; return rc ; error: if ( buf && nokRC.size() > 0 ) { *buf = rtnContextBuf( coordBuildErrorObj( _pResource, rc, cb, &nokRC ) ) ; } goto done ; }