diff options
Diffstat (limited to 'src/mongo/db/catalog/index_catalog_impl.h')
-rw-r--r-- | src/mongo/db/catalog/index_catalog_impl.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/index_catalog_impl.h b/src/mongo/db/catalog/index_catalog_impl.h index 655c43e6858..4576dddaa3c 100644 --- a/src/mongo/db/catalog/index_catalog_impl.h +++ b/src/mongo/db/catalog/index_catalog_impl.h @@ -67,6 +67,17 @@ public: // must be called before used Status init(OperationContext* opCtx, Collection* collection) override; + /** + * Must be called before used. + * + * When initializing an index that exists in 'preexistingIndexes', the IndexCatalogEntry will be + * taken from there instead of initializing a new IndexCatalogEntry. + */ + Status initFromExisting(OperationContext* opCtx, + Collection* collection, + const IndexCatalogEntryContainer& preexistingIndexes, + boost::optional<Timestamp> readTimestamp) override; + // ---- accessors ----- bool haveAnyIndexes() const override; @@ -300,6 +311,17 @@ private: static const BSONObj _idObj; // { _id : 1 } /** + * Helper for init() and initFromExisting(). + * + * Passing boost::none for 'preexistingIndexes' indicates that the IndexCatalog is not being + * initialized at an earlier point-in-time. + */ + Status _init(OperationContext* opCtx, + Collection* collection, + const IndexCatalogEntryContainer& preexistingIndexes, + boost::optional<Timestamp> readTimestamp); + + /** * In addition to IndexNames::findPluginName, validates that it is a known index type. * If all you need is to check for a certain type, just use IndexNames::findPluginName. * |