示例#1
0
   // PD_TRACE_DECLARE_FUNCTION ( SDB_RTNCOQUERY_GETNODEGROUPS, "rtnCoordQuery::getNodeGroups" )
   INT32 rtnCoordQuery::getNodeGroups( const CoordCataInfoPtr &cataInfo,
                                       BSONObj &queryObj,
                                       const CoordGroupList &sendGroupLst,
                                       CoordGroupList &groupLst )
   {
      INT32 rc = SDB_OK;
      PD_TRACE_ENTRY ( SDB_RTNCOQUERY_GETNODEGROUPS ) ;

      cataInfo->getGroupByMatcher( queryObj, groupLst ) ;
      PD_CHECK( groupLst.size() > 0, SDB_CAT_NO_MATCH_CATALOG, error, PDERROR,
               "failed to get match groups" );
      {
      CoordGroupList::const_iterator iterList
                              = sendGroupLst.begin();
      while( iterList != sendGroupLst.end() )
      {
         groupLst.erase( iterList->first );
         ++iterList;
      }
      }

   done:
      PD_TRACE_EXITRC ( SDB_RTNCOQUERY_GETNODEGROUPS, rc ) ;
      return rc;
   error:
      goto done;
   }
示例#2
0
 INT32 rtnCoordDelete::getNodeGroups( const CoordCataInfoPtr &cataInfo,
                         bson::BSONObj &deleteObj,
                         CoordGroupList &sendGroupLst,
                         CoordGroupList &groupLst )
 {
    INT32 rc = SDB_OK;
    PD_TRACE_ENTRY ( SDB_RTNCODEL_GETNODEGROUPS ) ;
    cataInfo->getGroupByMatcher( deleteObj, groupLst );
    if ( groupLst.size() <= 0 )
    {
       rc = SDB_CAT_NO_MATCH_CATALOG;
    }
    else
    {
       CoordGroupList::iterator iter = sendGroupLst.begin();
       while( iter != sendGroupLst.end() )
       {
          groupLst.erase( iter->first );
          ++iter;
       }
    }
    PD_TRACE_EXITRC ( SDB_RTNCODEL_GETNODEGROUPS, rc ) ;
    return rc;
 }