Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/mongo/db/modules/eloq/src/eloq_global_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -982,6 +994,10 @@ Status EloqGlobalOptions::store(const moe::Environment& params,
eloqGlobalOptions.eloqStoreCloudStorePath =
params["storage.eloq.storage.eloqStoreCloudStorePath"].as<std::string>();
}
if (params.count("storage.eloq.storage.eloqStoreCloudStoreDaemonPorts")) {
eloqGlobalOptions.eloqStoreCloudStoreDaemonPorts =
params["storage.eloq.storage.eloqStoreCloudStoreDaemonPorts"].as<std::string>();
}
if (params.count("storage.eloq.storage.eloqStoreDataPageRestartInterval")) {
eloqGlobalOptions.eloqStoreDataPageRestartInterval =
params["storage.eloq.storage.eloqStoreDataPageRestartInterval"].as<int>();
Expand Down Expand Up @@ -1070,6 +1086,10 @@ Status EloqGlobalOptions::store(const moe::Environment& params,
eloqGlobalOptions.eloqStoreEnableCompression =
params["storage.eloq.storage.eloqStoreEnableCompression"].as<bool>();
}
if (params.count("storage.eloq.storage.eloqStorePrewarmCloudCache")) {
eloqGlobalOptions.eloqStorePrewarmCloudCache =
params["storage.eloq.storage.eloqStorePrewarmCloudCache"].as<bool>();
}

// Parse metrics options

Expand Down
2 changes: 2 additions & 0 deletions src/mongo/db/modules/eloq/src/eloq_global_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <stdexcept>
#include <utility>
#include <vector>
#include <sstream>

#include "mongo/base/error_codes.h"
#include "mongo/db/auth/authorization_manager.h"
Expand Down Expand Up @@ -186,6 +187,20 @@ static void configureEloqStore(EloqDS::EloqStoreConfig& eloq_store_config,
log() << "EloqStore cloud store enabled";
}

if (!eloqGlobalOptions.eloqStoreCloudStoreDaemonPorts.empty()) {
std::vector<std::string> 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;

Expand Down Expand Up @@ -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

Expand Down