diff options
author | David Storch <david.storch@mongodb.com> | 2022-06-22 16:38:02 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-22 22:46:02 +0000 |
commit | eb8e6a0a8f090d761fc8450670c7636d976effc7 (patch) | |
tree | 382dc63c25f3613af8ffb5b1d59c8ef4612ffb86 /src/mongo/client/dbclient_connection.cpp | |
parent | 3fa2961b6463ffa5a1ef1211ed2162965fa9cb19 (diff) | |
download | mongo-eb8e6a0a8f090d761fc8450670c7636d976effc7.tar.gz |
SERVER-62206 Remove DBClientBase::query_DEPRECATED()
Also includes related simplifications to the implementation
of 'DBClientCursor'.
Diffstat (limited to 'src/mongo/client/dbclient_connection.cpp')
-rw-r--r-- | src/mongo/client/dbclient_connection.cpp | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp index c3651edb01c..1b87829c1cd 100644 --- a/src/mongo/client/dbclient_connection.cpp +++ b/src/mongo/client/dbclient_connection.cpp @@ -625,67 +625,6 @@ uint64_t DBClientConnection::getSockCreationMicroSec() const { } } -unsigned long long DBClientConnection::query_DEPRECATED( - std::function<void(DBClientCursorBatchIterator&)> f, - const NamespaceStringOrUUID& nsOrUuid, - const BSONObj& filter, - const client_deprecated::Query& querySettings, - const BSONObj* fieldsToReturn, - int queryOptions, - int batchSize, - boost::optional<BSONObj> readConcernObj) { - if (!(queryOptions & QueryOption_Exhaust)) { - return DBClientBase::query_DEPRECATED(f, - nsOrUuid, - filter, - querySettings, - fieldsToReturn, - queryOptions, - batchSize, - readConcernObj); - } - - // mask options - queryOptions &= - (int)(QueryOption_NoCursorTimeout | QueryOption_SecondaryOk | QueryOption_Exhaust); - - unique_ptr<DBClientCursor> c(this->query_DEPRECATED(nsOrUuid, - filter, - querySettings, - 0, - 0, - fieldsToReturn, - queryOptions, - batchSize, - readConcernObj)); - // Note that this->query will throw for network errors, so it is OK to return a numeric - // error code here. - uassert(13386, "socket error for mapping query", c.get()); - - unsigned long long n = 0; - - try { - while (1) { - while (c->moreInCurrentBatch()) { - DBClientCursorBatchIterator i(*c); - f(i); - n += i.n(); - } - - if (!c->more()) - break; - } - } catch (std::exception&) { - /* connection CANNOT be used anymore as more data may be on the way from the server. - we have to reconnect. - */ - _markFailed(kEndSession); - throw; - } - - return n; -} - DBClientConnection::DBClientConnection(bool _autoReconnect, double so_timeout, MongoURI uri, |