summaryrefslogtreecommitdiff
path: root/src/mongo/db/index/btree_access_method_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index/btree_access_method_internal.h')
-rw-r--r--src/mongo/db/index/btree_access_method_internal.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mongo/db/index/btree_access_method_internal.h b/src/mongo/db/index/btree_access_method_internal.h
index 4d2c61bd6a6..89c6ba57e5b 100644
--- a/src/mongo/db/index/btree_access_method_internal.h
+++ b/src/mongo/db/index/btree_access_method_internal.h
@@ -21,6 +21,7 @@
#include "mongo/bson/ordering.h"
#include "mongo/db/diskloc.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/index/btree_interface.h"
#include "mongo/db/index/index_access_method.h"
#include "mongo/db/index/index_cursor.h"
#include "mongo/db/index/index_descriptor.h"
@@ -35,7 +36,7 @@ namespace mongo {
* 2. override newCursor, and
* 3. override getKeys.
*/
- template <class Key> class BtreeBasedAccessMethod : public IndexAccessMethod {
+ class BtreeBasedAccessMethod : public IndexAccessMethod {
public:
BtreeBasedAccessMethod(IndexDescriptor *descriptor);
virtual ~BtreeBasedAccessMethod() { }
@@ -72,19 +73,29 @@ namespace mongo {
virtual void getKeys(const BSONObj &obj, BSONObjSet *keys) = 0;
- IndexDescriptor *_descriptor;
+ IndexDescriptor* _descriptor;
Ordering _ordering;
+ // There are 2 types of Btree disk formats. We put them both behind one interface.
+ BtreeInterface* _interface;
+
private:
bool removeOneKey(const BSONObj& key, const DiskLoc& loc);
};
- template <class Key> class BtreeBasedAccessMethod<Key>::BtreeBasedPrivateUpdateData
+ /**
+ * What data do we need to perform an update?
+ */
+ class BtreeBasedAccessMethod::BtreeBasedPrivateUpdateData
: public UpdateTicket::PrivateUpdateData {
public:
virtual ~BtreeBasedPrivateUpdateData() { }
+
BSONObjSet oldKeys, newKeys;
+
+ // These point into the sets oldKeys and newKeys.
vector<BSONObj*> removed, added;
+
DiskLoc loc;
bool dupsAllowed;
};