@@ -50,19 +50,31 @@ namespace mongo {
5050
5151 MONGO_EXPORT_SERVER_PARAMETER (failIndexKeyTooLong, bool , true );
5252
53- void BtreeBasedAccessMethod::InvalidateCursorsNotification::aboutToDeleteBucket (
54- const DiskLoc& bucket) {
55- BtreeIndexCursor::aboutToDeleteBucket (bucket);
56- }
53+ /* *
54+ * Invalidates all active cursors, which point at the bucket being deleted.
55+ */
56+ class InvalidateCursorsNotification : public BucketDeletionNotification {
57+ public:
58+ virtual void aboutToDeleteBucket (const DiskLoc& bucket) {
59+ BtreeIndexCursor::aboutToDeleteBucket (bucket);
60+ }
61+ };
5762
58- BtreeBasedAccessMethod:: InvalidateCursorsNotification BtreeBasedAccessMethod:: invalidateCursors;
63+ static InvalidateCursorsNotification invalidateCursors;
5964
6065 BtreeBasedAccessMethod::BtreeBasedAccessMethod (IndexCatalogEntry* btreeState,
61- BtreeInterface* btree )
66+ RecordStore* recordStore )
6267 : _btreeState(btreeState),
63- _descriptor (btreeState->descriptor ()),
64- _newInterface(btree) {
68+ _recordStore ( recordStore ),
69+ _descriptor(btreeState->descriptor ()) {
70+
6571 verify (0 == _descriptor->version () || 1 == _descriptor->version ());
72+ _newInterface.reset (BtreeInterface::getInterface (btreeState->headManager (),
73+ recordStore,
74+ btreeState->ordering (),
75+ _descriptor->indexNamespace (),
76+ _descriptor->version (),
77+ &invalidateCursors));
6678 }
6779
6880 // Find the keys for obj, put them in the tree pointing to loc
@@ -212,7 +224,7 @@ namespace mongo {
212224
213225
214226 Status BtreeBasedAccessMethod::touch ( OperationContext* txn ) const {
215- return _btree ->touch (txn);
227+ return _recordStore ->touch ( txn, NULL );
216228 }
217229
218230 DiskLoc BtreeBasedAccessMethod::findSingle (const BSONObj& key) const {
0 commit comments