Add new storage-provider-options config

Former-commit-id: 195a28beecc6094f959ddafef7fe33f5b55e4047
This commit is contained in:
John Sully 2020-07-14 04:24:46 +00:00
parent 731de57fb7
commit 9112445059
3 changed files with 4 additions and 2 deletions

View File

@ -313,7 +313,7 @@ bool initializeStorageProvider(const char **err)
{
// Create The Storage Factory (if necessary)
serverLog(LL_NOTICE, "Initializing FLASH storage provider (this may take a long time)");
g_pserver->m_pstorageFactory = CreateRocksDBStorageFactory(g_sdsArgs, cserver.dbnum);
g_pserver->m_pstorageFactory = CreateRocksDBStorageFactory(g_sdsArgs, cserver.dbnum, cserver.storage_conf, cserver.storage_conf ? strlen(cserver.storage_conf) : 0);
}
else if (!strcasecmp(g_sdsProvider, "test") && g_sdsArgs == nullptr)
{
@ -2324,6 +2324,7 @@ standardConfig configs[] = {
createStringConfig("bio_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->bio_cpulist, NULL, NULL, NULL),
createStringConfig("aof_rewrite_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->aof_rewrite_cpulist, NULL, NULL, NULL),
createStringConfig("bgsave_cpulist", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, g_pserver->bgsave_cpulist, NULL, NULL, NULL),
createStringConfig("storage-provider-options", NULL, IMMUTABLE_CONFIG, EMPTY_STRING_IS_NULL, cserver.storage_conf, NULL, NULL, NULL),
/* Enum Configs */
createEnumConfig("supervised", NULL, IMMUTABLE_CONFIG, supervised_mode_enum, cserver.supervised_mode, SUPERVISED_NONE, NULL, NULL),

View File

@ -2061,6 +2061,7 @@ struct redisServerConst {
int thread_min_client_threshold = 50;
int multimaster_no_forward;
int storage_memory_model = STORAGE_WRITETHROUGH;
char *storage_conf = nullptr;
};
struct redisServer {

View File

@ -1,3 +1,3 @@
#pragma once
class IStorageFactory *CreateRocksDBStorageFactory(const char *path, int dbnum);
class IStorageFactory *CreateRocksDBStorageFactory(const char *path, int dbnum, const char *rgchConfig, size_t cchConfig);