示例#1
0
    OID WriteBackManager::queueWriteBack( const string& remote , BSONObjBuilder& b ) {
        static mongo::mutex writebackIDOrdering( "WriteBackManager::queueWriteBack id ordering" );
        
        scoped_lock lk( writebackIDOrdering );

        OID writebackID;
        writebackID.initSequential();
        b.append( "id", writebackID );
        
        getWritebackQueue( remote )->queue.push( b.obj() );

        return writebackID;
    }
示例#2
0
        bool run(const string& , BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool){

            BSONElement e = cmdObj.firstElement();
            if ( e.type() != jstOID ){
                errmsg = "need oid as first value";
                return 0;
            }
            
            const OID id = e.__oid();
            BSONObj z = getWritebackQueue(id.str())->blockingPop();
            log(1) << "WriteBackCommand got : " << z << endl;
            
            result.append( "data" , z );
            
            return true;
        }
示例#3
0
    void WriteBackManager::queueWriteBack( const string& remote , const BSONObj& o ) {
        static mongo::mutex xxx( "WriteBackManager::queueWriteBack tmp" );
        static OID lastOID;

        scoped_lock lk( xxx );
        const BSONElement& e = o["id"];

        if ( lastOID.isSet() ) {
            if ( e.OID() < lastOID ) {
                log() << "this could fail" << endl;
                printStackTrace();
            }
        }
        lastOID = e.OID();
        getWritebackQueue( remote )->queue.push( o );
    }
示例#4
0
 void WriteBackManager::queueWriteBack( const string& remote , const BSONObj& o ) {
     getWritebackQueue( remote )->queue.push( o );
 }
示例#5
0
 void queueWriteBack( const string& remote , const BSONObj& o ){
     getWritebackQueue( remote )->push( o );
 }