diff options
Diffstat (limited to 'client/parallel.cpp')
-rw-r--r-- | client/parallel.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/client/parallel.cpp b/client/parallel.cpp index 449f436..bd29013 100644 --- a/client/parallel.cpp +++ b/client/parallel.cpp @@ -1,4 +1,20 @@ // parallel.cpp +/* + * Copyright 2010 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include "stdafx.h" #include "parallel.h" @@ -10,13 +26,12 @@ namespace mongo { // -------- ClusteredCursor ----------- - + ClusteredCursor::ClusteredCursor( QueryMessage& q ){ _ns = q.ns; _query = q.query.copy(); _options = q.queryOptions; - if ( q.fields.get() ) - _fields = q.fields->getSpec(); + _fields = q.fields; _done = false; } @@ -82,8 +97,8 @@ namespace mongo { // -------- SerialServerClusteredCursor ----------- - SerialServerClusteredCursor::SerialServerClusteredCursor( set<ServerAndQuery> servers , QueryMessage& q , int sortOrder) : ClusteredCursor( q ){ - for ( set<ServerAndQuery>::iterator i = servers.begin(); i!=servers.end(); i++ ) + SerialServerClusteredCursor::SerialServerClusteredCursor( const set<ServerAndQuery>& servers , QueryMessage& q , int sortOrder) : ClusteredCursor( q ){ + for ( set<ServerAndQuery>::const_iterator i = servers.begin(); i!=servers.end(); i++ ) _servers.push_back( *i ); if ( sortOrder > 0 ) @@ -119,14 +134,14 @@ namespace mongo { // -------- ParallelSortClusteredCursor ----------- - ParallelSortClusteredCursor::ParallelSortClusteredCursor( set<ServerAndQuery> servers , QueryMessage& q , + ParallelSortClusteredCursor::ParallelSortClusteredCursor( const set<ServerAndQuery>& servers , QueryMessage& q , const BSONObj& sortKey ) : ClusteredCursor( q ) , _servers( servers ){ _sortKey = sortKey.getOwned(); _init(); } - ParallelSortClusteredCursor::ParallelSortClusteredCursor( set<ServerAndQuery> servers , const string& ns , + ParallelSortClusteredCursor::ParallelSortClusteredCursor( const set<ServerAndQuery>& servers , const string& ns , const Query& q , int options , const BSONObj& fields ) : ClusteredCursor( ns , q.obj , options , fields ) , _servers( servers ){ |