diff options
author | Eliot Horowitz <eliot@10gen.com> | 2013-10-30 09:53:25 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2013-11-02 13:19:53 -0400 |
commit | 8bc2fd8c35414b99017068e68c505a2a1b14a2b2 (patch) | |
tree | e60cc2c832549b5f563ee552f07aa4b849923010 | |
parent | 8f73459ac4c750f9aaa957ec2c6e6569df43d8e4 (diff) | |
download | mongo-8bc2fd8c35414b99017068e68c505a2a1b14a2b2.tar.gz |
SERVER-11178: IndexLegacy partly to IndexCatalog
-rw-r--r-- | src/mongo/db/catalog/index_catalog.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/index_legacy.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/index_legacy.h | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp index 404d32e7471..3699bf60582 100644 --- a/src/mongo/db/catalog/index_catalog.cpp +++ b/src/mongo/db/catalog/index_catalog.cpp @@ -340,9 +340,9 @@ namespace mongo { _catalog->_collection->infoCache()->addedIndex(); - IndexLegacy::postBuildHook( _nsd, _nsd->idx( idxNo ) ); - _catalog->_fixDescriptorCacheNumbers(); + + IndexLegacy::postBuildHook( _catalog->_collection, _catalog->getDescriptor( idxNo ) ); } diff --git a/src/mongo/db/index_legacy.cpp b/src/mongo/db/index_legacy.cpp index 86e9cd88690..d76a0de8aa7 100644 --- a/src/mongo/db/index_legacy.cpp +++ b/src/mongo/db/index_legacy.cpp @@ -80,12 +80,13 @@ namespace mongo { } // static - void IndexLegacy::postBuildHook(NamespaceDetails* tableToIndex, const IndexDetails& idx) { + void IndexLegacy::postBuildHook(Collection* collection, IndexDescriptor* desc) { // If it's an FTS index, we want to set the power of 2 flag. - string pluginName = CatalogHack::getAccessMethodName(idx.keyPattern()); + string pluginName = collection->getIndexCatalog()->getAccessMethodName(desc->keyPattern()); if (IndexNames::TEXT == pluginName || IndexNames::TEXT_INTERNAL == pluginName) { - if (tableToIndex->setUserFlag(NamespaceDetails::Flag_UsePowerOf2Sizes)) { - tableToIndex->syncUserFlags(idx.parentNS()); + NamespaceDetails* nsd = collection->details(); + if (nsd->setUserFlag(NamespaceDetails::Flag_UsePowerOf2Sizes)) { + nsd->syncUserFlags(collection->ns().ns()); } } } diff --git a/src/mongo/db/index_legacy.h b/src/mongo/db/index_legacy.h index 95c39096782..7c12d0c695d 100644 --- a/src/mongo/db/index_legacy.h +++ b/src/mongo/db/index_legacy.h @@ -33,8 +33,8 @@ namespace mongo { - class IndexDetails; - class NamespaceDetails; + class Collection; + class IndexDescriptor; /** * There has been some behavior concerning indexed access patterns -- both pre and post-index @@ -73,7 +73,7 @@ namespace mongo { * This is a no-op unless the index is a FTS index. In that case, we set the flag for using * power of 2 sizes for space allocation. */ - static void postBuildHook(NamespaceDetails* tableToIndex, const IndexDetails& idx); + static void postBuildHook(Collection* collection, IndexDescriptor* descriptor); }; } // namespace mongo |