diff options
author | Andrew Morrow <acm@mongodb.com> | 2019-12-19 13:59:01 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-30 00:53:40 +0000 |
commit | beb9ffb3b326e22bea6e34abf17be8a2bc53df0a (patch) | |
tree | 36b1d85221c9815815067370c7a03d2cc84d4d92 /src/mongo/embedded/mongo_embedded | |
parent | 31d27b87be16f2ebb5fd76cd8aef9ab65378def4 (diff) | |
download | mongo-beb9ffb3b326e22bea6e34abf17be8a2bc53df0a.tar.gz |
SERVER-44548 Switch embedded over to use wiredtiger
delete mode 100644 src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in
delete mode 100644 src/mongo/embedded/mongoc_embedded/mongo-embedded-c-driver.podspec.in
delete mode 100644 src/mongo/embedded/mongoc_embedded/mongoc_embedded.podspec.in
Diffstat (limited to 'src/mongo/embedded/mongo_embedded')
4 files changed, 41 insertions, 80 deletions
diff --git a/src/mongo/embedded/mongo_embedded/SConscript b/src/mongo/embedded/mongo_embedded/SConscript index 8cf4efcf6be..44f7c02ebec 100644 --- a/src/mongo/embedded/mongo_embedded/SConscript +++ b/src/mongo/embedded/mongo_embedded/SConscript @@ -96,7 +96,6 @@ if get_option('link-model') != 'dynamic-sdk': '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/server_options_core', - '$BUILD_DIR/mongo/db/storage/mobile/storage_mobile_core', '$BUILD_DIR/mongo/rpc/protocol', '$BUILD_DIR/mongo/unittest/unittest', '$BUILD_DIR/mongo/util/net/network', diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp index e75edd1c0a3..1004122469b 100644 --- a/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp +++ b/src/mongo/embedded/mongo_embedded/mongo_embedded.cpp @@ -132,7 +132,7 @@ MongoEmbeddedStatusImpl* getStatusImpl(mongo_embedded_v1_status* status) { return status ? &status->statusImpl : nullptr; } -using MobileException = ExceptionForAPI<mongo_embedded_v1_error>; +using EmbeddedException = ExceptionForAPI<mongo_embedded_v1_error>; struct ServiceContextDestructor { void operator()(mongo::ServiceContext* const serviceContext) const noexcept { @@ -160,7 +160,7 @@ struct mongo_embedded_v1_instance { // creating mock transport layer to be able to create sessions transportLayer(std::make_unique<mongo::transport::TransportLayerMock>()) { if (!this->serviceContext) { - throw ::mongo::MobileException{ + throw ::mongo::EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_DB_INITIALIZATION_FAILED, "The MongoDB Embedded Library Failed to initialize the Service Context"}; } @@ -215,7 +215,7 @@ void registerLogCallback(mongo_embedded_v1_lib* const lib, mongo_embedded_v1_lib* capi_lib_init(mongo_embedded_v1_init_params const* params) try { if (library) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_LIBRARY_ALREADY_INITIALIZED, "Cannot initialize the MongoDB Embedded Library when it is already initialized."}; } @@ -257,27 +257,27 @@ mongo_embedded_v1_lib* capi_lib_init(mongo_embedded_v1_init_params const* params void capi_lib_fini(mongo_embedded_v1_lib* const lib) { if (!lib) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE, "Cannot close a `NULL` pointer referencing a MongoDB Embedded Library Instance"}; } if (!library) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, "Cannot close the MongoDB Embedded Library when it is not initialized"}; } if (library.get() != lib) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE, - "Invalid MongoDB Embedded Library handle."}; + throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE, + "Invalid MongoDB Embedded Library handle."}; } // This check is not possible to 100% guarantee. It is a best effort. The documentation of // this API says that the behavior of closing a `lib` with open handles is undefined, but may // provide diagnostic errors in some circumstances. if (lib->databaseCount.load() > 0) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_HAS_DB_HANDLES_OPEN, "Cannot close the MongoDB Embedded Library when it has database handles still open."}; } @@ -288,21 +288,21 @@ void capi_lib_fini(mongo_embedded_v1_lib* const lib) { mongo_embedded_v1_instance* instance_new(mongo_embedded_v1_lib* const lib, const char* const yaml_config) { if (!library) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, - "Cannot create a new database handle when the MongoDB Embedded " - "Library is not yet initialized."}; + throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, + "Cannot create a new database handle when the MongoDB Embedded " + "Library is not yet initialized."}; } if (library.get() != lib) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE, - "Cannot create a new database handle when the MongoDB Embedded " - "Library is not yet initialized."}; + throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_INVALID_LIB_HANDLE, + "Cannot create a new database handle when the MongoDB Embedded " + "Library is not yet initialized."}; } if (lib->onlyDB) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_DB_MAX_OPEN, - "The maximum number of permitted database handles for the MongoDB " - "Embedded Library have been opened."}; + throw EmbeddedException{MONGO_EMBEDDED_V1_ERROR_DB_MAX_OPEN, + "The maximum number of permitted database handles for the MongoDB " + "Embedded Library have been opened."}; } lib->onlyDB = std::make_unique<mongo_embedded_v1_instance>(lib, yaml_config); @@ -312,25 +312,26 @@ mongo_embedded_v1_instance* instance_new(mongo_embedded_v1_lib* const lib, void instance_destroy(mongo_embedded_v1_instance* const db) { if (!library) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, - "Cannot destroy a database handle when the MongoDB Embedded Library " - "is not yet initialized."}; + throw EmbeddedException{ + MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, + "Cannot destroy a database handle when the MongoDB Embedded Library " + "is not yet initialized."}; } if (!db) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, "Cannot close a `NULL` pointer referencing a MongoDB Embedded Database"}; } if (db != library->onlyDB.get()) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, "Cannot close the specified MongoDB Embedded Database, as it is not a valid instance."}; } if (db->clientCount.load() > 0) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_DB_CLIENTS_OPEN, "Cannot close a MongoDB Embedded Database instance while it has open clients"}; } @@ -340,21 +341,24 @@ void instance_destroy(mongo_embedded_v1_instance* const db) { mongo_embedded_v1_client* client_new(mongo_embedded_v1_instance* const db) { if (!library) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, - "Cannot create a new client handle when the MongoDB Embedded Library " - "is not yet initialized."}; + throw EmbeddedException{ + MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, + "Cannot create a new client handle when the MongoDB Embedded Library " + "is not yet initialized."}; } if (!db) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, - "Cannot use a `NULL` pointer referencing a MongoDB Embedded Database " - "when creating a new client"}; + throw EmbeddedException{ + MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, + "Cannot use a `NULL` pointer referencing a MongoDB Embedded Database " + "when creating a new client"}; } if (db != library->onlyDB.get()) { - throw MobileException{MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, - "The specified MongoDB Embedded Database instance cannot be used to " - "create a new client because it is invalid."}; + throw EmbeddedException{ + MONGO_EMBEDDED_V1_ERROR_INVALID_DB_HANDLE, + "The specified MongoDB Embedded Database instance cannot be used to " + "create a new client because it is invalid."}; } return new mongo_embedded_v1_client(db); @@ -362,13 +366,14 @@ mongo_embedded_v1_client* client_new(mongo_embedded_v1_instance* const db) { void client_destroy(mongo_embedded_v1_client* const client) { if (!library) { - throw MobileException(MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, - "Cannot destroy a database handle when the MongoDB Embedded Library " - "is not yet initialized."); + throw EmbeddedException( + MONGO_EMBEDDED_V1_ERROR_LIBRARY_NOT_INITIALIZED, + "Cannot destroy a database handle when the MongoDB Embedded Library " + "is not yet initialized."); } if (!client) { - throw MobileException{ + throw EmbeddedException{ MONGO_EMBEDDED_V1_ERROR_INVALID_CLIENT_HANDLE, "Cannot destroy a `NULL` pointer referencing a MongoDB Embedded Database Client"}; } diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in b/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in deleted file mode 100644 index dd44766f09f..00000000000 --- a/src/mongo/embedded/mongo_embedded/mongo_embedded.podspec.in +++ /dev/null @@ -1,33 +0,0 @@ -Pod::Spec.new do |s| - - s.name = "mongo_embedded" - s.version = "@VERSION@" - s.summary = "MongoDB Embedded" - - s.description = <<-DESC - An embedded library providing access to the MongoDB query language over local storage - DESC - - s.homepage = "https://www.mongodb.com" - s.author = { "MongoDB, Inc" => "cocoapods@mongodb.com" } - - s.license = { :type => "MongoDB Embedded License", :file => "iPhoneOS/Frameworks/mongo_embedded.framework/LICENSE-Embedded.txt" } - - s.ios.deployment_target = "11.0" - s.watchos.deployment_target = "4.3" - s.tvos.deployment_target = "10.2" - - s.source = { :http => "https://downloads.mongodb.org/mobile/apple/mongo-embedded-sdk-@VERSION@.tgz" - :sha256 => "@SHA256@" } - - s.ios.vendored_frameworks = "iPhoneOS/Frameworks/mongo_embedded.framework" - s.watchos.vendored_frameworks = "WatchOS/Frameworks/mongo_embedded.framework" - s.tvos.vendored_frameworks = "AppleTVOS/Frameworks/mongo_embedded.framework" - - # My current best understanding is that apple uses these to inject - # back in when running dsymutil on their side after regenerating a - # binary from the bitcode slices. So we need to keep these available - # in the pod so they get archived into end user application. - s.preserve_path = '**/*.bcsymbolmap' - -end diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp index 9bc12aeba19..a3755223912 100644 --- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp +++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp @@ -39,7 +39,6 @@ #include "mongo/db/commands/test_commands_enabled.h" #include "mongo/db/json.h" #include "mongo/db/server_options.h" -#include "mongo/db/storage/mobile/mobile_options.h" #include "mongo/embedded/mongo_embedded/mongo_embedded_test_gen.h" #include "mongo/rpc/message.h" #include "mongo/rpc/op_msg.h" @@ -110,9 +109,6 @@ protected: params.log_callback = nullptr; params.log_user_data = nullptr; - // Set a parameter that lives in mobileGlobalOptions to verify it can be set using YAML. - uint32_t vacuumCheckIntervalMinutes = 1; - YAML::Emitter yaml; yaml << YAML::BeginMap; @@ -120,10 +116,6 @@ protected: yaml << YAML::Value << YAML::BeginMap; yaml << YAML::Key << "dbPath"; yaml << YAML::Value << globalTempDir->path(); - yaml << YAML::Key << "mobile" << YAML::BeginMap; - yaml << YAML::Key << "vacuumCheckIntervalMinutes" << YAML::Value - << vacuumCheckIntervalMinutes; - yaml << YAML::EndMap; // mobile yaml << YAML::EndMap; // storage yaml << YAML::EndMap; @@ -135,8 +127,6 @@ protected: db = mongo_embedded_v1_instance_create(lib, yaml.c_str(), status); ASSERT(db != nullptr) << mongo_embedded_v1_status_get_explanation(status); - ASSERT(mongo::embedded::mobileGlobalOptions.vacuumCheckIntervalMinutes == - vacuumCheckIntervalMinutes); } void tearDown() { |