diff options
author | Kristina <kristina@10gen.com> | 2012-12-13 14:36:27 -0500 |
---|---|---|
committer | Kristina <kristina@10gen.com> | 2012-12-13 14:36:27 -0500 |
commit | 2812b757dd25de5ca22c3c84135f3c654ffcb928 (patch) | |
tree | a07fa759e9fcb8f01ae6f72bbed6ad170b5a9883 /src/mongo/db/namespace_details.h | |
parent | 5271c025f4dcb16801ab56b3ae4a017858687aa7 (diff) | |
download | mongo-2812b757dd25de5ca22c3c84135f3c654ffcb928.tar.gz |
SERVER-2771 Multiple index builds
Diffstat (limited to 'src/mongo/db/namespace_details.h')
-rw-r--r-- | src/mongo/db/namespace_details.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/db/namespace_details.h b/src/mongo/db/namespace_details.h index d75ace1dd77..898aeb58ed6 100644 --- a/src/mongo/db/namespace_details.h +++ b/src/mongo/db/namespace_details.h @@ -97,7 +97,7 @@ namespace mongo { unsigned long long reservedA; long long extraOffset; // where the $extra info is located (bytes relative to this) public: - int indexBuildInProgress; // 1 if in prog + int indexBuildsInProgress; // Number of indexes currently being built private: int _userFlags; char reserved[72]; @@ -182,7 +182,7 @@ namespace mongo { /* when a background index build is in progress, we don't count the index in nIndexes until complete, yet need to still use it in _indexRecord() - thus we use this function for that. */ - int nIndexesBeingBuilt() const { return nIndexes + indexBuildInProgress; } + int getTotalIndexCount() const { return nIndexes + indexBuildsInProgress; } /* NOTE: be careful with flags. are we manipulating them in read locks? if so, this isn't thread safe. TODO @@ -197,12 +197,6 @@ namespace mongo { IndexDetails& idx(int idxNo, bool missingExpected = false ); - /** get the IndexDetails for the index currently being built in the background. (there is at most one) */ - IndexDetails& inProgIdx() { - DEV verify(indexBuildInProgress); - return idx(nIndexes); - } - class IndexIterator { public: int pos() { return i; } // note this is the next one to come @@ -225,7 +219,7 @@ namespace mongo { for these, we have to do some dedup work on queries. */ bool isMultikey(int i) const { return (multiKeyIndexBits & (((unsigned long long) 1) << i)) != 0; } - void setIndexIsMultikey(const char *thisns, int i); + void setIndexIsMultikey(const char *thisns, int i, bool multikey = true); /** * This fetches the IndexDetails for the next empty index slot. The caller must populate |