diff options
author | Aaron <aaron@10gen.com> | 2012-10-25 14:07:23 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2012-11-08 16:32:38 -0800 |
commit | 6a51b6b01e4ebdd723e6ad33f07934d5558f9ad7 (patch) | |
tree | 28bcdb963e99f213a281148a53b3c801c5fb41d8 /src/mongo/db/pdfile.h | |
parent | f5d6b28def1f23def5cd1ba551f5dc73277407ff (diff) | |
download | mongo-6a51b6b01e4ebdd723e6ad33f07934d5558f9ad7.tar.gz |
SERVER-3067 Add killop support for foreground index builds.
Diffstat (limited to 'src/mongo/db/pdfile.h')
-rw-r--r-- | src/mongo/db/pdfile.h | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/src/mongo/db/pdfile.h b/src/mongo/db/pdfile.h index 984ea5cfa1e..797aac2585b 100644 --- a/src/mongo/db/pdfile.h +++ b/src/mongo/db/pdfile.h @@ -33,6 +33,7 @@ #include "mongo/db/namespace-inl.h" #include "mongo/db/namespace_details-inl.h" #include "mongo/db/namespacestring.h" +#include "mongo/platform/cstdint.h" #include "mongo/util/log.h" #include "mongo/util/mmap.h" @@ -131,16 +132,37 @@ namespace mongo { // The object o may be updated if modified on insert. void insertAndLog( const char *ns, const BSONObj &o, bool god = false, bool fromMigrate = false ); - /** insert will add an _id to the object if not present. if you would like to see the final object - after such an addition, use this method. - @param o both and in and out param - */ - DiskLoc insertWithObjMod(const char *ns, BSONObj & /*out*/o, bool god = false); + /** + * insert() will add an _id to the object if not present. If you would like to see the + * final object after such an addition, use this method. + * @param o both and in and out param + * @param mayInterrupt When true, killop may interrupt the function call. + */ + DiskLoc insertWithObjMod(const char* ns, + BSONObj& /*out*/o, + bool mayInterrupt = false, + bool god = false); /** @param obj in value only for this version. */ void insertNoReturnVal(const char *ns, BSONObj o, bool god = false); - DiskLoc insert(const char *ns, const void *buf, int len, bool god = false, bool mayAddIndex = true, bool *addedID = 0); + /** + * Insert the contents of @param buf with length @param len into namespace @param ns. + * @param mayInterrupt When true, killop may interrupt the function call. + * @param god if true, you may pass in obuf of NULL and then populate the returned DiskLoc + * after the call -- that will prevent a double buffer copy in some cases (btree.cpp). + * @param mayAddIndex almost always true, except for invocation from rename namespace + * command. + * @param addedID if not null, set to true if adding _id element. You must assure false + * before calling if using. + */ + DiskLoc insert(const char* ns, + const void* buf, + int32_t len, + bool mayInterrupt = false, + bool god = false, + bool mayAddIndex = true, + bool* addedID = 0); static shared_ptr<Cursor> findAll(const char *ns, const DiskLoc &startLoc = DiskLoc()); /* special version of insert for transaction logging -- streamlined a bit. @@ -604,10 +626,15 @@ namespace mongo { return reinterpret_cast<DeletedRecord*>(getRecord(dl)); } - void ensureHaveIdIndex(const char *ns); - inline BSONObj BSONObj::make(const Record* r ) { return BSONObj( r->data() ); } - + + DiskLoc allocateSpaceForANewRecord(const char* ns, + NamespaceDetails* d, + int32_t lenWHdr, + bool god); + + void addRecordToRecListInExtent(Record* r, DiskLoc loc); + } // namespace mongo |