Esempio n. 1
0
    UpdateResult updateObjectsForReplication( const char* ns,
                                              const BSONObj& updateobj,
                                              const BSONObj& patternOrig,
                                              bool upsert,
                                              bool multi,
                                              bool logop ,
                                              OpDebug& debug,
                                              bool fromMigrate,
                                              const QueryPlanSelectionPolicy& planPolicy ) {

        validateUpdate( ns , updateobj , patternOrig );

        UpdateResult ur = _updateObjects(false,
                                         ns,
                                         updateobj,
                                         patternOrig,
                                         upsert,
                                         multi,
                                         logop,
                                         debug,
                                         NULL /* no remove saver */,
                                         fromMigrate,
                                         planPolicy,
                                         true /* for replication */ );
        debug.nupdated = ur.num;
        return ur;
    }
Esempio n. 2
0
    UpdateResult updateObjects( const char* ns,
                                const BSONObj& updateobj,
                                const BSONObj& patternOrig,
                                bool upsert,
                                bool multi,
                                bool logop ,
                                OpDebug& debug,
                                bool fromMigrate,
                                const QueryPlanSelectionPolicy& planPolicy ) {

        validateUpdate( ns , updateobj , patternOrig );

        if ( isNewUpdateFrameworkEnabled() ) {

            UpdateResult ur = _updateObjectsNEW(false, ns, updateobj, patternOrig,
                                                upsert, multi, logop,
                                                debug, NULL, fromMigrate, planPolicy );
            debug.nupdated = ur.num;
            return ur;
        }
        else {

            UpdateResult ur = _updateObjects(false, ns, updateobj, patternOrig,
                                             upsert, multi, logop,
                                             debug, NULL, fromMigrate, planPolicy );
            debug.nupdated = ur.num;
            return ur;
        }
    }
Esempio n. 3
0
    void Helpers::putSingletonGod(const char *ns, BSONObj obj, bool logTheOp) {
        OpDebug debug;
        Client::Context context(ns);

        if (isNewUpdateFrameworkEnabled()) {

            _updateObjectsNEW(/*god=*/true,
                              ns,
                              obj,
                              /*pattern=*/BSONObj(),
                              /*upsert=*/true,
                              /*multi=*/false,
                              logTheOp,
                              debug );

        }
        else {

            _updateObjects(/*god=*/true,
                           ns,
                           obj,
                           /*pattern=*/BSONObj(),
                           /*upsert=*/true,
                           /*multi=*/false,
                           logTheOp,
                           debug );

        }

        context.getClient()->curop()->done();
    }
Esempio n. 4
0
    UpdateResult updateObjects( const char* ns,
                                const BSONObj& updateobj,
                                const BSONObj& patternOrig,
                                bool upsert,
                                bool multi,
                                bool logop ,
                                OpDebug& debug,
                                bool fromMigrate,
                                const QueryPlanSelectionPolicy& planPolicy ) {

        validateUpdate( ns , updateobj , patternOrig );

        UpdateResult ur = _updateObjects(ns, updateobj, patternOrig,
                                         upsert, multi, logop,
                                         debug, fromMigrate, planPolicy );
        debug.nupdated = ur.num;
        return ur;
    }
Esempio n. 5
0
    UpdateResult updateObjects( const char* ns,
                                const BSONObj& updateobj,
                                const BSONObj& patternOrig,
                                bool upsert,
                                bool multi,
                                bool logop ,
                                OpDebug& debug,
                                bool fromMigrate,
                                const QueryPlanSelectionPolicy& planPolicy ) {

        uassert( 10155 , "cannot update reserved $ collection", strchr(ns, '$') == 0 );
        if ( strstr(ns, ".system.") ) {
            /* dm: it's very important that system.indexes is never updated as IndexDetails has pointers into it */
            uassert( 10156,
                     str::stream() << "cannot update system collection: " << ns << " q: " << patternOrig << " u: " << updateobj,
                     legalClientSystemNS( ns , true ) );
        }

        UpdateResult ur = _updateObjects(false, ns, updateobj, patternOrig,
                                         upsert, multi, logop,
                                         debug, 0, fromMigrate, planPolicy );
        debug.nupdated = ur.num;
        return ur;
    }
Esempio n. 6
0
 void Helpers::putSingletonGod(const char *ns, BSONObj obj, bool logTheOp) {
     OpDebug debug;
     Client::Context context(ns);
     _updateObjects(/*god=*/true, ns, obj, /*pattern=*/BSONObj(), /*upsert=*/true, /*multi=*/false , logTheOp , debug );
 }
Esempio n. 7
0
void	SfBall::_update() {
    _checkEvents();
    _updateObjects();
    _resetMousePosition();
}