diff options
Diffstat (limited to 'db/clientcursor.h')
-rw-r--r-- | db/clientcursor.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/db/clientcursor.h b/db/clientcursor.h index 46570c30f22..015b2e2c4b3 100644 --- a/db/clientcursor.h +++ b/db/clientcursor.h @@ -1,3 +1,19 @@ +/** +* Copyright (C) 2008 10gen Inc. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License, version 3, +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + /* clientcursor.h Cursor -- and its derived classes -- are our internal cursors. @@ -36,6 +52,11 @@ public: auto_ptr< set<string> > filter; // which fields query wants returned Message originalMessage; // this is effectively an auto ptr for data the matcher points to. + /* Get rid of cursors for namespaces that begin with nsprefix. + Used by drop, deleteIndexes, dropDatabase. + */ + static void invalidate(const char *nsPrefix); + static bool erase(CursorId id) { ClientCursor *cc = find(id); if( cc ) { @@ -45,10 +66,11 @@ public: return false; } - static ClientCursor* find(CursorId id) { + static ClientCursor* find(CursorId id, bool warn = true) { CCById::iterator it = clientCursorsById.find(id); if( it == clientCursorsById.end() ) { - cout << "ClientCursor::find(): cursor not found in map " << id << '\n'; + if( warn ) + OCCASIONALLY cout << "ClientCursor::find(): cursor not found in map " << id << " (ok after a drop)\n"; return 0; } return it->second; @@ -60,10 +82,5 @@ public: */ void updateLocation(); -//private: -// void addToByLocation(DiskLoc cl); void cleanupByLocation(DiskLoc loc); -//public: -// ClientCursor *nextAtThisLocation; }; - |