summaryrefslogtreecommitdiff
path: root/s/strategy.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-04 00:40:41 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-04 00:40:41 -0500
commitb828d21630d8715fff5a30c682a51ab79880093d (patch)
treecbbc46069dcfc08ab1525ec06a5dff5967dde148 /s/strategy.cpp
parent4315a900ae604e11f2d9d68d1e6f87b8aa01dddc (diff)
downloadmongo-b828d21630d8715fff5a30c682a51ab79880093d.tar.gz
ran astyle SERVER-2304
Diffstat (limited to 's/strategy.cpp')
-rw-r--r--s/strategy.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/s/strategy.cpp b/s/strategy.cpp
index 8017a7f51f1..d562507bc65 100644
--- a/s/strategy.cpp
+++ b/s/strategy.cpp
@@ -32,42 +32,42 @@ namespace mongo {
// ----- Strategy ------
- void Strategy::doWrite( int op , Request& r , const Shard& shard , bool checkVersion ){
+ void Strategy::doWrite( int op , Request& r , const Shard& shard , bool checkVersion ) {
ShardConnection conn( shard , r.getns() );
if ( ! checkVersion )
conn.donotCheckVersion();
- else if ( conn.setVersion() ){
+ else if ( conn.setVersion() ) {
conn.done();
throw StaleConfigException( r.getns() , "doWRite" , true );
}
conn->say( r.m() );
conn.done();
}
-
- void Strategy::doQuery( Request& r , const Shard& shard ){
-
+
+ void Strategy::doQuery( Request& r , const Shard& shard ) {
+
ShardConnection dbcon( shard , r.getns() );
DBClientBase &c = dbcon.conn();
-
+
Message response;
bool ok = c.call( r.m(), response);
uassert( 10200 , "mongos: error calling db", ok );
-
+
{
QueryResult *qr = (QueryResult *) response.singleData();
- if ( qr->resultFlags() & ResultFlag_ShardConfigStale ){
- dbcon.done();
- throw StaleConfigException( r.getns() , "Strategy::doQuery" );
- }
+ if ( qr->resultFlags() & ResultFlag_ShardConfigStale ) {
+ dbcon.done();
+ throw StaleConfigException( r.getns() , "Strategy::doQuery" );
+ }
}
-
+
r.reply( response , c.getServerAddress() );
dbcon.done();
}
-
- void Strategy::insert( const Shard& shard , const char * ns , const BSONObj& obj ){
+
+ void Strategy::insert( const Shard& shard , const char * ns , const BSONObj& obj ) {
ShardConnection dbcon( shard , ns );
- if ( dbcon.setVersion() ){
+ if ( dbcon.setVersion() ) {
dbcon.done();
throw StaleConfigException( ns , "for insert" );
}