31 #include <initializer_list> 34 #include "mongo/db/jsobj.h" 35 #include "mongo/db/operation_context_noop.h" 36 #include "mongo/db/record_id.h" 37 #include "mongo/db/service_context.h" 38 #include "mongo/db/service_context_noop.h" 41 #include "mongo/stdx/memory.h" 42 #include "mongo/util/unowned_ptr.h" 46 const BSONObj
key0 = BSON(
"" << 0);
47 const BSONObj
key1 = BSON(
"" << 1);
48 const BSONObj
key2 = BSON(
"" << 2);
49 const BSONObj
key3 = BSON(
"" << 3);
50 const BSONObj
key4 = BSON(
"" << 4);
51 const BSONObj
key5 = BSON(
"" << 5);
52 const BSONObj
key6 = BSON(
"" << 6);
75 const RecordId
loc1(0, 42);
76 const RecordId
loc2(0, 44);
77 const RecordId
loc3(0, 46);
78 const RecordId
loc4(0, 48);
79 const RecordId
loc5(0, 50);
80 const RecordId
loc6(0, 52);
81 const RecordId
loc7(0, 54);
82 const RecordId
loc8(0, 56);
96 bool unique, std::initializer_list<IndexKeyEntry> toInsert);
107 unowned_ptr<SortedDataInterface> index,
108 std::initializer_list<IndexKeyEntry> toInsert);
111 unowned_ptr<SortedDataInterface> index,
112 std::initializer_list<IndexKeyEntry> toInsert) {
113 auto client = harness->serviceContext()->makeClient(
"insertToIndex");
124 unowned_ptr<SortedDataInterface> index,
125 std::initializer_list<IndexKeyEntry> toRemove);
128 unowned_ptr<SortedDataInterface> index,
129 std::initializer_list<IndexKeyEntry> toRemove) {
130 auto client = harness->serviceContext()->makeClient(
"removeFromIndex");
std::unique_ptr< Target > dynamic_ptr_cast(std::unique_ptr< Current > &&p)
Definition: test_harness_helper.h:102
const BSONObj key0
Definition: sorted_data_interface_test_harness.h:46
Definition: sorted_data_interface_test_harness.h:86
const RecordId loc1(0, 42)
const BSONObj key4
Definition: sorted_data_interface_test_harness.h:50
const RecordId loc4(0, 48)
const BSONObj compoundKey3a
Definition: sorted_data_interface_test_harness.h:68
const BSONObj key1
Definition: sorted_data_interface_test_harness.h:47
const BSONObj compoundKey1d
Definition: sorted_data_interface_test_harness.h:60
const BSONObj compoundKey2a
Definition: sorted_data_interface_test_harness.h:62
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
const RecordId loc2(0, 44)
Client * client() const
Definition: test_harness_helper.h:72
const BSONObj key3
Definition: sorted_data_interface_test_harness.h:49
std::unique_ptr< SortedDataInterfaceHarnessHelper > newSortedDataInterfaceHarnessHelper()
Definition: sorted_data_interface_test_harness.h:134
virtual std::unique_ptr< SortedDataInterface > newSortedDataInterface(bool unique)=0
const BSONObj compoundKey2c
Definition: sorted_data_interface_test_harness.h:66
const BSONObj compoundKey1a
Definition: sorted_data_interface_test_harness.h:54
Sets up an OperationContext with a Recovery Unit.
Definition: test_harness_helper.h:55
const BSONObj key5
Definition: sorted_data_interface_test_harness.h:51
const BSONObj compoundKey2b
Definition: sorted_data_interface_test_harness.h:64
A RecoveryUnit is responsible for ensuring that data is persisted.
Definition: recovery_unit.h:51
const RecordId loc7(0, 54)
const RecordId loc8(0, 56)
const RecordId loc6(0, 52)
std::unique_ptr< HarnessHelper > newHarnessHelper()
Definition: test_harness_helper.cpp:49
const BSONObj compoundKey3c
Definition: sorted_data_interface_test_harness.h:72
void insertToIndex(unowned_ptr< OperationContext > opCtx, unowned_ptr< SortedDataInterface > index, std::initializer_list< IndexKeyEntry > toInsert)
Inserts all entries in toInsert into index.
Definition: sorted_data_interface_test_harness.cpp:50
void removeFromIndex(unowned_ptr< OperationContext > opCtx, unowned_ptr< SortedDataInterface > index, std::initializer_list< IndexKeyEntry > toRemove)
Removes all entries in toRemove from index.
Definition: sorted_data_interface_test_harness.cpp:60
const BSONObj key2
Definition: sorted_data_interface_test_harness.h:48
const RecordId loc3(0, 46)
const BSONObj compoundKey1b
Definition: sorted_data_interface_test_harness.h:56
const BSONObj compoundKey1c
Definition: sorted_data_interface_test_harness.h:58
Collection *const OperationContext *const opCtx
Definition: collection_impl.cpp:80
const BSONObj key6
Definition: sorted_data_interface_test_harness.h:52
const RecordId loc5(0, 50)
const BSONObj compoundKey3b
Definition: sorted_data_interface_test_harness.h:70