diff options
author | Ben Becker <ben.becker@10gen.com> | 2012-12-06 14:38:10 -0800 |
---|---|---|
committer | Ben Becker <ben.becker@10gen.com> | 2012-12-06 14:38:10 -0800 |
commit | 5e5afe90d148fb93d4c0b05470681d57de5bc3e9 (patch) | |
tree | 9d1370fbd01450d7df4b8604d7348f3760c1c701 /src/mongo/db/pdfile.h | |
parent | 0ed90ac0464147051864d722fc7b7833bbe383b3 (diff) | |
download | mongo-5e5afe90d148fb93d4c0b05470681d57de5bc3e9.tar.gz |
SERVER-3160: Sort index keys during clone
Diffstat (limited to 'src/mongo/db/pdfile.h')
-rw-r--r-- | src/mongo/db/pdfile.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mongo/db/pdfile.h b/src/mongo/db/pdfile.h index f489431c648..53467fad484 100644 --- a/src/mongo/db/pdfile.h +++ b/src/mongo/db/pdfile.h @@ -43,11 +43,12 @@ namespace mongo { const int PDFILE_VERSION = 4; const int PDFILE_VERSION_MINOR = 5; + class Cursor; class DataFileHeader; class Extent; - class Record; - class Cursor; class OpDebug; + class Record; + class SortPhaseOne; void dropDatabase(const std::string& db); bool repairDatabase(string db, string &errmsg, bool preserveClonedFilesOnFailure = false, bool backupOriginalFiles = false); @@ -115,6 +116,7 @@ namespace mongo { class DataFileMgr { friend class BasicCursor; public: + DataFileMgr(); void init(const string& path ); /* see if we can find an extent of the right size in the freelist. */ @@ -182,8 +184,21 @@ namespace mongo { /* does not clean up indexes, etc. : just deletes the record in the pdfile. use deleteRecord() to unindex */ void _deleteRecord(NamespaceDetails *d, const char *ns, Record *todelete, const DiskLoc& dl); + /** + * accessor/mutator for the 'precalced' keys (that is, sorted index keys) + * + * NB: 'precalced' is accessed from fastBuildIndex(), which is called from insert-related + * methods like insertWithObjMod(). It is mutated from various callers of the insert + * methods, which assume 'precalced' will not change while in the insert method. This + * should likely be refactored so theDataFileMgr takes full responsibility. + */ + SortPhaseOne* getPrecalced() const; + void setPrecalced(SortPhaseOne* precalced); + mongo::mutex _precalcedMutex; + private: vector<MongoDataFile *> files; + SortPhaseOne* _precalced; }; extern DataFileMgr theDataFileMgr; |