diff options
Diffstat (limited to 'src/mongo/db/index/index_access_method.h')
| -rw-r--r-- | src/mongo/db/index/index_access_method.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/mongo/db/index/index_access_method.h b/src/mongo/db/index/index_access_method.h index ad61cc5a25e..18d96a2218d 100644 --- a/src/mongo/db/index/index_access_method.h +++ b/src/mongo/db/index/index_access_method.h @@ -40,6 +40,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/operation_context.h" #include "mongo/db/record_id.h" +#include "mongo/db/sorter/sorter.h" #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/db/yieldable.h" @@ -72,6 +73,9 @@ public: IndexAccessMethod() = default; virtual ~IndexAccessMethod() = default; + static std::unique_ptr<IndexAccessMethod> make( + IndexCatalogEntry* entry, std::unique_ptr<SortedDataInterface> sortedDataInterface); + /** * Equivalent to (but shorter and faster than): dynamic_cast<SortedDataIndexAccessMethod*>(this) */ @@ -185,7 +189,6 @@ public: */ virtual Status insert(OperationContext* opCtx, const CollectionPtr& collection, - SharedBufferFragmentBuilder& pooledBuilder, const BSONObj& obj, const RecordId& loc, const InsertDeleteOptions& options, @@ -218,6 +221,12 @@ public: * Persists on disk the keys that have been inserted using this BulkBuilder. */ virtual IndexStateInfo persistDataForShutdown() = 0; + + protected: + static void countNewBuildInStats(); + static void countResumedBuildInStats(); + static SorterFileStats* bulkBuilderFileStats(); + static SorterTracker* bulkBuilderTracker(); }; /** @@ -240,23 +249,6 @@ public: }; /** - * Factory class that constructs an IndexAccessMethod depending on the type of index. - */ -class IndexAccessMethodFactory { -public: - IndexAccessMethodFactory() = default; - virtual ~IndexAccessMethodFactory() = default; - - static IndexAccessMethodFactory* get(ServiceContext* service); - static IndexAccessMethodFactory* get(OperationContext* opCtx); - static void set(ServiceContext* service, - std::unique_ptr<IndexAccessMethodFactory> collectionFactory); - - virtual std::unique_ptr<IndexAccessMethod> make( - IndexCatalogEntry* entry, std::unique_ptr<SortedDataInterface> sortedDataInterface) = 0; -}; - -/** * Updates are two steps: verify that it's a valid update, and perform it. * prepareUpdate fills out the UpdateStatus and update actually applies it. */ |
