@@ -170,7 +170,7 @@ BSONObj ReplSource::jsobj() {
170170
171171 BSONObjBuilder dbsNextPassBuilder;
172172 int n = 0 ;
173- for (set<string>::iterator i = addDbNextPass.begin (); i != addDbNextPass.end (); i++) {
173+ for (set<std:: string>::iterator i = addDbNextPass.begin (); i != addDbNextPass.end (); i++) {
174174 n++;
175175 dbsNextPassBuilder.appendBool (*i, 1 );
176176 }
@@ -179,7 +179,7 @@ BSONObj ReplSource::jsobj() {
179179
180180 BSONObjBuilder incompleteCloneDbsBuilder;
181181 n = 0 ;
182- for (set<string>::iterator i = incompleteCloneDbs.begin (); i != incompleteCloneDbs.end (); i++) {
182+ for (set<std:: string>::iterator i = incompleteCloneDbs.begin (); i != incompleteCloneDbs.end (); i++) {
183183 n++;
184184 incompleteCloneDbsBuilder.appendBool (*i, 1 );
185185 }
@@ -190,7 +190,7 @@ BSONObj ReplSource::jsobj() {
190190}
191191
192192void ReplSource::ensureMe (OperationContext* opCtx) {
193- string myname = getHostName ();
193+ std:: string myname = getHostName ();
194194
195195 // local.me is an identifier for a server for getLastError w:2+
196196 bool exists = Helpers::getSingleton (opCtx, " local.me" , _me);
@@ -381,7 +381,7 @@ class HandshakeCmd : public BasicCommand {
381381 }
382382
383383 virtual bool run (OperationContext* opCtx,
384- const string& ns,
384+ const std:: string& ns,
385385 const BSONObj& cmdObj,
386386 BSONObjBuilder& result) {
387387 HandshakeArgs handshake;
@@ -399,7 +399,7 @@ class HandshakeCmd : public BasicCommand {
399399} handshakeCmd;
400400
401401bool replHandshake (DBClientConnection* conn, const OID& myRID) {
402- string myname = getHostName ();
402+ std:: string myname = getHostName ();
403403
404404 BSONObjBuilder cmd;
405405 cmd.append (" handshake" , myRID);
@@ -450,7 +450,7 @@ void ReplSource::forceResync(OperationContext* opCtx, const char* requester) {
450450 BSONElement e = i.next ();
451451 if (e.eoo ())
452452 break ;
453- string name = e.embeddedObject ().getField (" name" ).valuestr ();
453+ std:: string name = e.embeddedObject ().getField (" name" ).valuestr ();
454454 if (!e.embeddedObject ().getBoolField (" empty" )) {
455455 if (name != " local" ) {
456456 if (only.empty () || only == name) {
@@ -481,7 +481,7 @@ Status ReplSource::_updateIfDoneWithInitialSync() {
481481 return Status::OK ();
482482}
483483
484- void ReplSource::resyncDrop (OperationContext* opCtx, const string& dbName) {
484+ void ReplSource::resyncDrop (OperationContext* opCtx, const std:: string& dbName) {
485485 log () << " resync: dropping database " << dbName;
486486 invariant (opCtx->lockState ()->isW ());
487487
@@ -531,13 +531,13 @@ void ReplSource::resync(OperationContext* opCtx, const std::string& dbName) {
531531
532532static DatabaseIgnorer ___databaseIgnorer;
533533
534- void DatabaseIgnorer::doIgnoreUntilAfter (const string& db, const Timestamp& futureOplogTime) {
534+ void DatabaseIgnorer::doIgnoreUntilAfter (const std:: string& db, const Timestamp& futureOplogTime) {
535535 if (futureOplogTime > _ignores[db]) {
536536 _ignores[db] = futureOplogTime;
537537 }
538538}
539539
540- bool DatabaseIgnorer::ignoreAt (const string& db, const Timestamp& currentOplogTime) {
540+ bool DatabaseIgnorer::ignoreAt (const std:: string& db, const Timestamp& currentOplogTime) {
541541 if (_ignores[db].isNull ()) {
542542 return false ;
543543 }
@@ -627,7 +627,7 @@ bool ReplSource::handleDuplicateDbName(OperationContext* opCtx,
627627
628628 // The database is present on the master and no conflicting databases
629629 // are present on the master. Drop any local conflicts.
630- for (set<string>::const_iterator i = duplicates.begin (); i != duplicates.end (); ++i) {
630+ for (set<std:: string>::const_iterator i = duplicates.begin (); i != duplicates.end (); ++i) {
631631 ___databaseIgnorer.doIgnoreUntilAfter (*i, lastTime);
632632 incompleteCloneDbs.erase (*i);
633633 addDbNextPass.erase (*i);
@@ -822,10 +822,10 @@ void ReplSource::_sync_pullOpLog_applyOperation(OperationContext* opCtx,
822822}
823823
824824void ReplSource::syncToTailOfRemoteLog () {
825- string _ns = ns ();
825+ std:: string _ns = ns ();
826826 BSONObjBuilder b;
827827 if (!only.empty ()) {
828- b.appendRegex (" ns" , string (" ^" ) + pcrecpp::RE::QuoteMeta (only));
828+ b.appendRegex (" ns" , std:: string (" ^" ) + pcrecpp::RE::QuoteMeta (only));
829829 }
830830 BSONObj last = oplogReader.findOne (_ns.c_str (), Query (b.done ()).sort (BSON (" $natural" << -1 )));
831831 if (!last.isEmpty ()) {
@@ -873,7 +873,7 @@ class ReplApplyBatchSize
873873*/
874874int ReplSource::_sync_pullOpLog (OperationContext* opCtx, int & nApplied) {
875875 int okResultCode = restartSyncAfterSleep;
876- string ns = string (" local.oplog.$" ) + sourceName ();
876+ std:: string ns = std:: string (" local.oplog.$" ) + sourceName ();
877877 LOG (2 ) << " sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong () << ' \n ' ;
878878
879879 bool tailing = true ;
@@ -893,7 +893,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* opCtx, int& nApplied) {
893893 BSONElement e = i.next ();
894894 if (e.eoo ())
895895 break ;
896- string name = e.embeddedObject ().getField (" name" ).valuestr ();
896+ std:: string name = e.embeddedObject ().getField (" name" ).valuestr ();
897897 if (!e.embeddedObject ().getBoolField (" empty" )) {
898898 if (name != " local" ) {
899899 if (only.empty () || only == name) {
@@ -916,7 +916,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* opCtx, int& nApplied) {
916916 if (!only.empty ()) {
917917 // note we may here skip a LOT of data table scanning, a lot of work for the master.
918918 // maybe append "\\." here?
919- query.appendRegex (" ns" , string (" ^" ) + pcrecpp::RE::QuoteMeta (only));
919+ query.appendRegex (" ns" , std:: string (" ^" ) + pcrecpp::RE::QuoteMeta (only));
920920 }
921921 BSONObj queryObj = query.done ();
922922 // e.g. queryObj = { ts: { $gte: syncedTo } }
@@ -935,7 +935,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* opCtx, int& nApplied) {
935935
936936 // show any deferred database creates from a previous pass
937937 {
938- set<string>::iterator i = addDbNextPass.begin ();
938+ set<std:: string>::iterator i = addDbNextPass.begin ();
939939 if (i != addDbNextPass.end ()) {
940940 BSONObjBuilder b;
941941 b.append (" ns" , *i + ' .' );
@@ -978,7 +978,7 @@ int ReplSource::_sync_pullOpLog(OperationContext* opCtx, int& nApplied) {
978978 BSONObj op = oplogReader.nextSafe ();
979979 BSONElement ts = op.getField (" ts" );
980980 if (ts.type () != Date && ts.type () != bsonTimestamp) {
981- string err = op.getStringField (" $err" );
981+ std:: string err = op.getStringField (" $err" );
982982 if (!err.empty ()) {
983983 // 13051 is "tailable cursor requested on non capped collection"
984984 if (op.getIntField (" code" ) == 13051 ) {
@@ -1143,7 +1143,7 @@ int ReplSource::sync(OperationContext* opCtx, int& nApplied) {
11431143
11441144 // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
11451145 // hostName.
1146- if ((string (" localhost" ) == hostName || string (" 127.0.0.1" ) == hostName) &&
1146+ if ((std:: string (" localhost" ) == hostName || std:: string (" 127.0.0.1" ) == hostName) &&
11471147 serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
11481148 log () << " can't sync from self (localhost). sources configuration may be wrong." << endl;
11491149 sleepsecs (5 );
@@ -1283,7 +1283,7 @@ static void replMain(OperationContext* opCtx) {
12831283 if (s) {
12841284 stringstream ss;
12851285 ss << " sleep " << s << " sec before next pass" ;
1286- string msg = ss.str ();
1286+ std:: string msg = ss.str ();
12871287 if (!serverGlobalParams.quiet .load ())
12881288 log () << msg << endl;
12891289 ReplInfo r (msg.c_str ());
0 commit comments