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, 18 insertions, 10 deletions
diff --git a/src/mongo/db/index/index_access_method.h b/src/mongo/db/index/index_access_method.h index 18d96a2218d..ad61cc5a25e 100644 --- a/src/mongo/db/index/index_access_method.h +++ b/src/mongo/db/index/index_access_method.h @@ -40,7 +40,6 @@ #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" @@ -73,9 +72,6 @@ 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) */ @@ -189,6 +185,7 @@ public: */ virtual Status insert(OperationContext* opCtx, const CollectionPtr& collection, + SharedBufferFragmentBuilder& pooledBuilder, const BSONObj& obj, const RecordId& loc, const InsertDeleteOptions& options, @@ -221,12 +218,6 @@ 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(); }; /** @@ -249,6 +240,23 @@ 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. */ |
