summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-10-08 12:04:27 -0400
committerEliot Horowitz <eliot@10gen.com>2009-10-08 12:04:27 -0400
commit677fbad312059efb0a8a8abecf220520facaa40b (patch)
tree7753b97db1a0612a4534fef5094407d431162186
parentf88a4415b6894cf44db2cc8a5ae666152e531404 (diff)
downloadmongo-677fbad312059efb0a8a8abecf220520facaa40b.tar.gz
client cursor cleaning and fix masked error
-rw-r--r--db/btree.cpp4
-rw-r--r--db/clientcursor.cpp12
-rw-r--r--db/pdfile.cpp4
3 files changed, 5 insertions, 15 deletions
diff --git a/db/btree.cpp b/db/btree.cpp
index 34b7b7f5c24..a9bc4abadaf 100644
--- a/db/btree.cpp
+++ b/db/btree.cpp
@@ -21,6 +21,7 @@
#include "pdfile.h"
#include "../util/unittest.h"
#include "json.h"
+#include "clientcursor.h"
namespace mongo {
@@ -433,9 +434,8 @@ namespace mongo {
return false;
}
- void aboutToDeleteBucket(const DiskLoc&);
void BtreeBucket::delBucket(const DiskLoc& thisLoc, IndexDetails& id) {
- aboutToDeleteBucket(thisLoc);
+ ClientCursor::aboutToDeleteBucket(thisLoc);
assert( !isHead() );
BtreeBucket *p = parent.btreemod();
diff --git a/db/clientcursor.cpp b/db/clientcursor.cpp
index ea5bebe6822..e65a38391f4 100644
--- a/db/clientcursor.cpp
+++ b/db/clientcursor.cpp
@@ -37,9 +37,6 @@ namespace mongo {
inline unsigned ClientCursor::byLocSize() {
return byLoc.size();
}
- unsigned byLocSize() {
- return ClientCursor::byLocSize();
- }
void ClientCursor::setLastLoc(DiskLoc L) {
if ( L == _lastLoc )
@@ -95,24 +92,20 @@ namespace mongo {
}
}
}
- void idleTimeReport(unsigned millis) { ClientCursor::idleTimeReport(millis); }
/* must call when a btree bucket going away.
note this is potentially slow
*/
- inline void ClientCursor::aboutToDeleteBucket(const DiskLoc& b) {
+ void ClientCursor::aboutToDeleteBucket(const DiskLoc& b) {
RARELY if ( byLoc.size() > 70 ) {
log() << "perf warning: byLoc.size=" << byLoc.size() << " in aboutToDeleteBucket\n";
}
for ( CCByLoc::iterator i = byLoc.begin(); i != byLoc.end(); i++ )
i->second->c->aboutToDeleteBucket(b);
}
- void aboutToDeleteBucket(const DiskLoc& b) {
- ClientCursor::aboutToDeleteBucket(b);
- }
/* must call this on a delete so we clean up the cursors. */
- inline void ClientCursor::aboutToDelete(const DiskLoc& dl) {
+ void ClientCursor::aboutToDelete(const DiskLoc& dl) {
CCByLoc::iterator j = byLoc.lower_bound(dl);
CCByLoc::iterator stop = byLoc.upper_bound(dl);
if ( j == stop )
@@ -152,7 +145,6 @@ namespace mongo {
}
}
}
- void aboutToDelete(const DiskLoc& dl) { ClientCursor::aboutToDeleteBucket(dl); }
ClientCursor::~ClientCursor() {
assert( pos != -2 );
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index b7c7e6ddb4d..c7946aacb3a 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -550,8 +550,6 @@ assert( !eloc.isNull() );
}
}
- void aboutToDelete(const DiskLoc& dl);
-
/* drop a collection/namespace */
void dropNS(const string& nsToDrop) {
NamespaceDetails* d = nsdetails(nsToDrop.c_str());
@@ -845,7 +843,7 @@ assert( !eloc.isNull() );
}
/* check if any cursors point to us. if so, advance them. */
- aboutToDelete(dl);
+ ClientCursor::aboutToDelete(dl);
unindexRecord(d, todelete, dl, noWarn);