diff options
author | Jason Rassi <rassi@10gen.com> | 2014-12-23 12:06:46 -0500 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2014-12-23 22:55:51 -0500 |
commit | 7494d33c77932db60fb8cdcc1abb178e67d8c60a (patch) | |
tree | e0f2a6bd2ca23f41a0044663c48a00ba07554cb4 /src/mongo/db/commands | |
parent | 6105f06402fe1e7578d41f3e4e583a1476ef2455 (diff) | |
download | mongo-7494d33c77932db60fb8cdcc1abb178e67d8c60a.tar.gz |
SERVER-16520 ClientCursor keeps ptr to owning CollectionCursorCache
Changes ClientCursor::_collection to ClientCursor::_cursorCache, and
updates ClientCursor/ClientCursorPin interfaces accordingly.
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/parallel_collection_scan.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/commands/repair_cursor.cpp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp index fed47ad30d2..e36ad731d83 100644 --- a/src/mongo/db/commands/parallel_collection_scan.cpp +++ b/src/mongo/db/commands/parallel_collection_scan.cpp @@ -137,7 +137,8 @@ namespace mongo { for (size_t i = 0; i < execs.size(); i++) { // transfer ownership of an executor to the ClientCursor (which manages its own // lifetime). - ClientCursor* cc = new ClientCursor( collection, execs.releaseAt(i) ); + ClientCursor* cc = new ClientCursor( collection->cursorCache(), + execs.releaseAt(i) ); // we are mimicking the aggregation cursor output here // that is why there are ns, ok and empty firstBatch diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index ae6ab10004a..18daf7facbd 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -275,9 +275,10 @@ namespace mongo { if (collection) { // XXX const bool isAggCursor = true; // enable special locking behavior - ClientCursor* cursor = new ClientCursor(collection, execHolder.release(), 0, - BSONObj(), isAggCursor); - pin.reset(new ClientCursorPin(collection, cursor->cursorid())); + ClientCursor* cursor = new ClientCursor(collection->cursorCache(), + execHolder.release(), 0, BSONObj(), + isAggCursor); + pin.reset(new ClientCursorPin(collection->cursorCache(), cursor->cursorid())); // Don't add any code between here and the start of the try block. } } diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp index a2247aab680..c968b03c1be 100644 --- a/src/mongo/db/commands/repair_cursor.cpp +++ b/src/mongo/db/commands/repair_cursor.cpp @@ -102,7 +102,7 @@ namespace mongo { // ClientCursors' constructor inserts them into a global map that manages their // lifetimes. That is why the next line isn't leaky. - ClientCursor* cc = new ClientCursor(collection, exec.release()); + ClientCursor* cc = new ClientCursor(collection->cursorCache(), exec.release()); BSONObjBuilder cursorObj(result.subobjStart("cursor")); cursorObj.append("id", cc->cursorid()); |