Storage Engine API
record_store_test_harness.h
Go to the documentation of this file.
1 // record_store_test_harness.h
2 
31 #pragma once
32 
33 #include <cstdint>
34 
35 #include "mongo/db/operation_context_noop.h"
36 #include "mongo/db/service_context_noop.h"
38 #include "mongo/stdx/memory.h"
39 
40 namespace mongo {
41 
42 class RecordStore;
43 class RecoveryUnit;
44 
46 public:
47  virtual std::unique_ptr<RecordStore> newNonCappedRecordStore() = 0;
48 
49  virtual std::unique_ptr<RecordStore> newNonCappedRecordStore(const std::string& ns) = 0;
50 
51  static const int64_t kDefaultCapedSizeBytes = 16 * 1024 * 1024;
52  virtual std::unique_ptr<RecordStore> newCappedRecordStore(
53  int64_t cappedSizeBytes = kDefaultCapedSizeBytes, int64_t cappedMaxDocs = -1) = 0;
54 
55  virtual std::unique_ptr<RecordStore> newCappedRecordStore(const std::string& ns,
56  int64_t cappedSizeBytes,
57  int64_t cappedMaxDocs) = 0;
58 
64  virtual bool supportsDocLocking() = 0;
65 };
66 
67 inline std::unique_ptr<RecordStoreHarnessHelper> newRecordStoreHarnessHelper() {
69 }
70 } // namespace mongo
std::unique_ptr< Target > dynamic_ptr_cast(std::unique_ptr< Current > &&p)
Definition: test_harness_helper.h:102
Collection *const const NamespaceString & ns
Definition: collection_info_cache_impl.cpp:53
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
virtual std::unique_ptr< RecordStore > newNonCappedRecordStore()=0
Sets up an OperationContext with a Recovery Unit.
Definition: test_harness_helper.h:55
Definition: record_store_test_harness.h:45
std::unique_ptr< HarnessHelper > newHarnessHelper()
Definition: test_harness_helper.cpp:49
static const int64_t kDefaultCapedSizeBytes
Definition: record_store_test_harness.h:51
std::unique_ptr< RecordStoreHarnessHelper > newRecordStoreHarnessHelper()
Definition: record_store_test_harness.h:67
virtual std::unique_ptr< RecordStore > newCappedRecordStore(int64_t cappedSizeBytes=kDefaultCapedSizeBytes, int64_t cappedMaxDocs=-1)=0
virtual bool supportsDocLocking()=0
Currently this requires that it is possible to have two independent open write operations at the same...