diff --git a/src/mongo/db/modules/eloq/src/eloq_global_options.cpp b/src/mongo/db/modules/eloq/src/eloq_global_options.cpp index 62b20a7201..59f735b2f7 100644 --- a/src/mongo/db/modules/eloq/src/eloq_global_options.cpp +++ b/src/mongo/db/modules/eloq/src/eloq_global_options.cpp @@ -425,6 +425,12 @@ Status EloqGlobalOptions::add(moe::OptionSection* options) { moe::String, "EloqStore cloud store path (Disable cloud store if empty)") .setDefault(moe::Value("")); + eloqOptions + .addOptionChaining("storage.eloq.storage.eloqStoreCloudStoreDaemonPorts", + "eloqEloqStoreCloudStoreDaemonPorts", + moe::String, + "Comma-separated cloud store daemon ports, e.g. \"5572,5573,5574\"") + .setDefault(moe::Value("")); eloqOptions .addOptionChaining("storage.eloq.storage.eloqStoreDataPageRestartInterval", "eloqEloqStoreDataPageRestartInterval", @@ -574,6 +580,12 @@ Status EloqGlobalOptions::add(moe::OptionSection* options) { moe::Bool, "EloqStore enable compression") .setDefault(moe::Value(false)); + eloqOptions + .addOptionChaining("storage.eloq.storage.eloqStorePrewarmCloudCache", + "eloqEloqStorePrewarmCloudCache", + moe::Bool, + "EloqStore prewarm cloud cache on startup") + .setDefault(moe::Value(false)); // Options for metrics eloqOptions @@ -982,6 +994,10 @@ Status EloqGlobalOptions::store(const moe::Environment& params, eloqGlobalOptions.eloqStoreCloudStorePath = params["storage.eloq.storage.eloqStoreCloudStorePath"].as(); } + if (params.count("storage.eloq.storage.eloqStoreCloudStoreDaemonPorts")) { + eloqGlobalOptions.eloqStoreCloudStoreDaemonPorts = + params["storage.eloq.storage.eloqStoreCloudStoreDaemonPorts"].as(); + } if (params.count("storage.eloq.storage.eloqStoreDataPageRestartInterval")) { eloqGlobalOptions.eloqStoreDataPageRestartInterval = params["storage.eloq.storage.eloqStoreDataPageRestartInterval"].as(); @@ -1070,6 +1086,10 @@ Status EloqGlobalOptions::store(const moe::Environment& params, eloqGlobalOptions.eloqStoreEnableCompression = params["storage.eloq.storage.eloqStoreEnableCompression"].as(); } + if (params.count("storage.eloq.storage.eloqStorePrewarmCloudCache")) { + eloqGlobalOptions.eloqStorePrewarmCloudCache = + params["storage.eloq.storage.eloqStorePrewarmCloudCache"].as(); + } // Parse metrics options diff --git a/src/mongo/db/modules/eloq/src/eloq_global_options.h b/src/mongo/db/modules/eloq/src/eloq_global_options.h index 826f150cd9..b6cdb0d812 100644 --- a/src/mongo/db/modules/eloq/src/eloq_global_options.h +++ b/src/mongo/db/modules/eloq/src/eloq_global_options.h @@ -122,6 +122,7 @@ class EloqGlobalOptions { bool eloqStoreSkipVerifyChecksum{false}; bool eloqStoreDataAppendMode{false}; bool eloqStoreEnableCompression{false}; + bool eloqStorePrewarmCloudCache{false}; uint32_t eloqStoreWorkerCount{1}; uint32_t eloqStoreOpenFilesLimit{1024}; uint32_t eloqStoreDataPageRestartInterval{16}; @@ -142,6 +143,7 @@ class EloqGlobalOptions { uint32_t eloqStorePagesPerFileShift{11}; uint32_t eloqStoreOverflowPointers{16}; std::string eloqStoreCloudStorePath; + std::string eloqStoreCloudStoreDaemonPorts; std::string eloqStoreLocalSpaceLimit; std::string eloqStoreStoragePathList; std::string eloqStoreIndexBufferPoolSize; diff --git a/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp b/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp index db39debd3a..6341ba78ad 100644 --- a/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp +++ b/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "mongo/base/error_codes.h" #include "mongo/db/auth/authorization_manager.h" @@ -186,6 +187,20 @@ static void configureEloqStore(EloqDS::EloqStoreConfig& eloq_store_config, log() << "EloqStore cloud store enabled"; } + if (!eloqGlobalOptions.eloqStoreCloudStoreDaemonPorts.empty()) { + std::vector ports; + std::string token; + std::istringstream tokenStream(eloqGlobalOptions.eloqStoreCloudStoreDaemonPorts); + while (std::getline(tokenStream, token, ',')) { + if (!token.empty()) { + ports.emplace_back(token); + } + } + if (!ports.empty()) { + eloq_store_config.eloqstore_configs_.cloud_store_daemon_ports = std::move(ports); + } + } + eloq_store_config.eloqstore_configs_.data_page_restart_interval = eloqGlobalOptions.eloqStoreDataPageRestartInterval; @@ -249,6 +264,9 @@ static void configureEloqStore(EloqDS::EloqStoreConfig& eloq_store_config, eloq_store_config.eloqstore_configs_.enable_compression = eloqGlobalOptions.eloqStoreEnableCompression; + + eloq_store_config.eloqstore_configs_.prewarm_cloud_cache = + eloqGlobalOptions.eloqStorePrewarmCloudCache; } #endif