0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/s/strategy.cpp
Eliot Horowitz c97ed5184b moveshard
2009-02-20 13:46:57 -05:00

27 lines
700 B
C++

// stragegy.cpp
#include "stdafx.h"
#include "request.h"
#include "../client/connpool.h"
#include "../db/commands.h"
namespace mongo {
void Strategy::doWrite( int op , Request& r , string server ){
ScopedDbConnection dbcon( server );
DBClientBase &_c = dbcon.conn();
/* TODO FIX - do not case and call DBClientBase::say() */
DBClientConnection&c = dynamic_cast<DBClientConnection&>(_c);
c.port().say( r.m() );
dbcon.done();
}
void Strategy::insert( string server , const char * ns , const BSONObj& obj ){
ScopedDbConnection dbcon( server );
dbcon->insert( ns , obj );
dbcon.done();
}
}