summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/devnull
diff options
context:
space:
mode:
authorEric Cox <eric.cox@mongodb.com>2021-10-14 22:15:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-14 23:01:03 +0000
commitd8781cb284af784447af76e1a7bcebc4079cc4c9 (patch)
treebbc4e98c0f11b466995e6f1ccf097f0a8cb1f196 /src/mongo/db/storage/devnull
parentdafc2856951315b8711b57e57c47ece00df3911f (diff)
downloadmongo-d8781cb284af784447af76e1a7bcebc4079cc4c9.tar.gz
SERVER-59075 Create temporary RecordStore in HashAgg stage
Diffstat (limited to 'src/mongo/db/storage/devnull')
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.cpp17
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.h3
2 files changed, 13 insertions, 7 deletions
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
index 144b289e27e..4b8ef17e47d 100644
--- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
+++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
@@ -60,8 +60,11 @@ public:
class DevNullRecordStore : public RecordStore {
public:
- DevNullRecordStore(StringData ns, StringData identName, const CollectionOptions& options)
- : RecordStore(ns, identName), _options(options) {
+ DevNullRecordStore(StringData ns,
+ StringData identName,
+ const CollectionOptions& options,
+ KeyFormat keyFormat)
+ : RecordStore(ns, identName), _options(options), _keyFormat(keyFormat) {
_numInserts = 0;
_dummy = BSON("_id" << 1);
}
@@ -85,7 +88,7 @@ public:
}
virtual KeyFormat keyFormat() const {
- return KeyFormat::Long;
+ return _keyFormat;
}
virtual int64_t storageSize(OperationContext* opCtx,
@@ -155,6 +158,7 @@ public:
private:
CollectionOptions _options;
+ KeyFormat _keyFormat;
long long _numInserts;
BSONObj _dummy;
};
@@ -240,12 +244,13 @@ std::unique_ptr<RecordStore> DevNullKVEngine::getRecordStore(OperationContext* o
if (ident == "_mdb_catalog") {
return std::make_unique<EphemeralForTestRecordStore>(ns, ident, &_catalogInfo);
}
- return std::make_unique<DevNullRecordStore>(ns, ident, options);
+ return std::make_unique<DevNullRecordStore>(ns, ident, options, KeyFormat::Long);
}
std::unique_ptr<RecordStore> DevNullKVEngine::makeTemporaryRecordStore(OperationContext* opCtx,
- StringData ident) {
- return std::make_unique<DevNullRecordStore>("" /* ns */, ident, CollectionOptions());
+ StringData ident,
+ KeyFormat keyFormat) {
+ return std::make_unique<DevNullRecordStore>("" /* ns */, ident, CollectionOptions(), keyFormat);
}
std::unique_ptr<SortedDataInterface> DevNullKVEngine::getSortedDataInterface(
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.h b/src/mongo/db/storage/devnull/devnull_kv_engine.h
index e3f3f2ae3f3..7327d8541fc 100644
--- a/src/mongo/db/storage/devnull/devnull_kv_engine.h
+++ b/src/mongo/db/storage/devnull/devnull_kv_engine.h
@@ -62,7 +62,8 @@ public:
const CollectionOptions& options);
virtual std::unique_ptr<RecordStore> makeTemporaryRecordStore(OperationContext* opCtx,
- StringData ident) override;
+ StringData ident,
+ KeyFormat keyFormat) override;
virtual Status createSortedDataInterface(OperationContext* opCtx,
const CollectionOptions& collOptions,