summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-02-17 18:20:42 -0500
committerDan Pasette <dan@mongodb.com>2015-02-19 20:31:23 -0500
commita162b3564dbfcedc431addf6b543320c26755e6a (patch)
tree1de07090354e40e74396da62d86dae5f5c3468e8 /src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
parent3e03e174fdc6e40c5f69a411293b58387113a06e (diff)
downloadmongo-a162b3564dbfcedc431addf6b543320c26755e6a.tar.gz
SERVER-17312 collmod command now handles parsing of all arguments
For the two currently supported engine-specific options, the collmod command will handle parsing the arguments and tell the CollectionCatalogEntry to update it's flags option. This removes the ability of storage engines to have custom options that can be changed after the collection is created. There were issues related to argument validation and replication of changes (including for initial sync). A correct solution will be designed as SERVER-17320. (cherry picked from commit ae18bbec33db1c4bf57d328505474eb7bba517df) Conflicts: src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.h
Diffstat (limited to 'src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp')
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
index 58a5ceeb317..6dcefefc735 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
@@ -42,33 +42,6 @@ namespace {
using std::string;
- TEST(SimpleRecordStoreV1, ChangeNoPaddingSetting) {
- OperationContextNoop txn;
- DummyExtentManager em;
- DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 );
-
- string myns = "test.foo";
- SimpleRecordStoreV1 rs(&txn, myns, md, &em, false);
-
- BSONObjBuilder info;
-
- ASSERT_FALSE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding));
-
- ASSERT_OK(rs.setCustomOption(&txn, BSON("noPadding" << true).firstElement(), &info));
- ASSERT_TRUE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding));
-
- ASSERT_OK(rs.setCustomOption(&txn, BSON("noPadding" << false).firstElement(), &info));
- ASSERT_FALSE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding));
-
- // duplicate names are expected since we reused the same builder.
- const BSONObj expectedInfo = BSON("noPadding_old" << false
- << "noPadding_new" << true
- << "noPadding_old" << true
- << "noPadding_new" << false
- );
- ASSERT_EQUALS(info.done(), expectedInfo);
- }
-
TEST( SimpleRecordStoreV1, quantizeAllocationSpaceSimple ) {
ASSERT_EQUALS(RecordStoreV1Base::quantizeAllocationSpace(33), 64);
ASSERT_EQUALS(RecordStoreV1Base::quantizeAllocationSpace(1000), 1024);
@@ -157,7 +130,7 @@ namespace {
OperationContextNoop txn;
DummyExtentManager em;
DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 );
- md->setUserFlag(&txn, RecordStoreV1Base::Flag_NoPadding);
+ md->setUserFlag(&txn, CollectionOptions::Flag_NoPadding);
string myns = "test.AllocQuantized";
SimpleRecordStoreV1 rs( &txn, myns, md, &em, false );
@@ -174,7 +147,7 @@ namespace {
OperationContextNoop txn;
DummyExtentManager em;
DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 );
- md->setUserFlag(&txn, RecordStoreV1Base::Flag_NoPadding);
+ md->setUserFlag(&txn, CollectionOptions::Flag_NoPadding);
string myns = "test.AllocQuantized";
SimpleRecordStoreV1 rs( &txn, myns, md, &em, false );