提交 399fde46 编写于 作者: K KernelMaker

beta-2.2.0

上级 bbc49422
...@@ -23,9 +23,9 @@ CXX = g++ ...@@ -23,9 +23,9 @@ CXX = g++
ifeq ($(__REL), 1) ifeq ($(__REL), 1)
#CXXFLAGS = -Wall -W -DDEBUG -g -O0 -D__XDEBUG__ -fPIC -Wno-unused-function -std=c++11 #CXXFLAGS = -Wall -W -DDEBUG -g -O0 -D__XDEBUG__ -fPIC -Wno-unused-function -std=c++11
CXXFLAGS = -O2 -g -pipe -fPIC -W -DNDEBUG -Wwrite-strings -Wpointer-arith -Wreorder -Wswitch -Wsign-promo -Wredundant-decls -Wformat -Wall -Wno-unused-parameter -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -std=c++11 -gdwarf-2 -Wno-redundant-decls CXXFLAGS = -O2 -g -pipe -fPIC -W -DNDEBUG -Wwrite-strings -Wpointer-arith -Wreorder -Wswitch -Wsign-promo -Wredundant-decls -Wformat -Wall -Wno-unused-parameter -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX -std=c++11 -gdwarf-2 -Wno-redundant-decls
else else
CXXFLAGS = -O0 -g -pg -pipe -fPIC -W -DDEBUG -Wwrite-strings -Wpointer-arith -Wreorder -Wswitch -Wsign-promo -Wredundant-decls -Wformat -Wall -Wno-unused-parameter -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -std=c++11 -Wno-redundant-decls CXXFLAGS = -O0 -g -pg -pipe -fPIC -W -DDEBUG -Wwrite-strings -Wpointer-arith -Wreorder -Wswitch -Wsign-promo -Wredundant-decls -Wformat -Wall -Wno-unused-parameter -D_GNU_SOURCE -D__STDC_FORMAT_MACROS -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX -std=c++11 -Wno-redundant-decls
endif endif
OBJECT = pika OBJECT = pika
...@@ -38,6 +38,8 @@ INCLUDE_PATH = -I./include/ \ ...@@ -38,6 +38,8 @@ INCLUDE_PATH = -I./include/ \
-I./src/ \ -I./src/ \
-I$(THIRD_PATH)/glog/src/ \ -I$(THIRD_PATH)/glog/src/ \
-I$(THIRD_PATH)/nemo/output/include/ \ -I$(THIRD_PATH)/nemo/output/include/ \
-I$(THIRD_PATH)/nemo/3rdparty/nemo-rocksdb/rocksdb/ \
-I$(THIRD_PATH)/nemo/3rdparty/nemo-rocksdb/rocksdb/include \
-I$(THIRD_PATH)/slash/output/include/ \ -I$(THIRD_PATH)/slash/output/include/ \
-I$(THIRD_PATH)/pink/output/include/ \ -I$(THIRD_PATH)/pink/output/include/ \
-I$(THIRD_PATH)/pink/output/ -I$(THIRD_PATH)/pink/output/
...@@ -52,6 +54,7 @@ LIB_PATH = -L./ \ ...@@ -52,6 +54,7 @@ LIB_PATH = -L./ \
LIBS = -lpthread \ LIBS = -lpthread \
-lglog \ -lglog \
-lnemo \ -lnemo \
-lnemodb \
-lslash \ -lslash \
-lrocksdb \ -lrocksdb \
-lpink \ -lpink \
......
...@@ -67,6 +67,8 @@ compression : snappy ...@@ -67,6 +67,8 @@ compression : snappy
# max-background-flushes: default is 1, limited in [1, 4] # max-background-flushes: default is 1, limited in [1, 4]
max-background-flushes : 1 max-background-flushes : 1
# max-background-compactions: default is 1, limited in [1, 4] # max-background-compactions: default is 1, limited in [1, 4]
max-background-compactions : 1 max-background-compactions : 2
# max-cache-files default is 5000 # max-cache-files default is 5000
max-cache-files : 5000 max-cache-files : 5000
# max_bytes_for_level_multiplier: default is 10, you can change it to 5
max-bytes-for-level-multiplier : 10
...@@ -55,6 +55,7 @@ public: ...@@ -55,6 +55,7 @@ public:
int max_background_flushes() { RWLock l(&rwlock_, false); return max_background_flushes_; } int max_background_flushes() { RWLock l(&rwlock_, false); return max_background_flushes_; }
int max_background_compactions() { RWLock l(&rwlock_, false); return max_background_compactions_; } int max_background_compactions() { RWLock l(&rwlock_, false); return max_background_compactions_; }
int max_cache_files() { RWLock l(&rwlock_, false); return max_cache_files_; } int max_cache_files() { RWLock l(&rwlock_, false); return max_cache_files_; }
int max_bytes_for_level_multiplier() {RWLock l(&rwlock_, false); return max_bytes_for_level_multiplier_; }
int expire_logs_nums() { RWLock l(&rwlock_, false); return expire_logs_nums_; } int expire_logs_nums() { RWLock l(&rwlock_, false); return expire_logs_nums_; }
int expire_logs_days() { RWLock l(&rwlock_, false); return expire_logs_days_; } int expire_logs_days() { RWLock l(&rwlock_, false); return expire_logs_days_; }
std::string conf_path() { RWLock l(&rwlock_, false); return conf_path_; } std::string conf_path() { RWLock l(&rwlock_, false); return conf_path_; }
...@@ -175,6 +176,7 @@ private: ...@@ -175,6 +176,7 @@ private:
int max_background_flushes_; int max_background_flushes_;
int max_background_compactions_; int max_background_compactions_;
int max_cache_files_; int max_cache_files_;
int max_bytes_for_level_multiplier_;
std::string network_interface_; std::string network_interface_;
//char username_[30]; //char username_[30];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define PIKA_MAX_WORKER_THREAD_NUM 24 #define PIKA_MAX_WORKER_THREAD_NUM 24
const std::string kPikaVersion = "2.1.5"; const std::string kPikaVersion = "2.2.0";
const std::string kPikaPidFile = "pika.pid"; const std::string kPikaPidFile = "pika.pid";
struct ClientInfo { struct ClientInfo {
......
...@@ -832,6 +832,10 @@ void ConfigCmd::ConfigGet(std::string &ret) { ...@@ -832,6 +832,10 @@ void ConfigCmd::ConfigGet(std::string &ret) {
ret = "*2\r\n"; ret = "*2\r\n";
EncodeString(&ret, "max-cache-files"); EncodeString(&ret, "max-cache-files");
EncodeInt32(&ret, g_pika_conf->max_cache_files()); EncodeInt32(&ret, g_pika_conf->max_cache_files());
} else if (get_item == "max-bytes-for-level-multiplier") {
ret = "*2\r\n";
EncodeString(&ret, "max-bytes-for-level-multiplier");
EncodeInt32(&ret, g_pika_conf->max_bytes_for_level_multiplier());
} else if (get_item == "expire-logs-days") { } else if (get_item == "expire-logs-days") {
ret = "*2\r\n"; ret = "*2\r\n";
EncodeString(&ret, "expire-logs-days"); EncodeString(&ret, "expire-logs-days");
...@@ -869,7 +873,7 @@ void ConfigCmd::ConfigGet(std::string &ret) { ...@@ -869,7 +873,7 @@ void ConfigCmd::ConfigGet(std::string &ret) {
EncodeString(&ret, "slaveof"); EncodeString(&ret, "slaveof");
EncodeString(&ret, g_pika_conf->slaveof()); EncodeString(&ret, g_pika_conf->slaveof());
} else if (get_item == "*") { } else if (get_item == "*") {
ret = "*70\r\n"; ret = "*72\r\n";
EncodeString(&ret, "port"); EncodeString(&ret, "port");
EncodeInt32(&ret, g_pika_conf->port()); EncodeInt32(&ret, g_pika_conf->port());
EncodeString(&ret, "thread-num"); EncodeString(&ret, "thread-num");
...@@ -918,6 +922,8 @@ void ConfigCmd::ConfigGet(std::string &ret) { ...@@ -918,6 +922,8 @@ void ConfigCmd::ConfigGet(std::string &ret) {
EncodeInt32(&ret, g_pika_conf->max_background_compactions()); EncodeInt32(&ret, g_pika_conf->max_background_compactions());
EncodeString(&ret, "max-cache-files"); EncodeString(&ret, "max-cache-files");
EncodeInt32(&ret, g_pika_conf->max_cache_files()); EncodeInt32(&ret, g_pika_conf->max_cache_files());
EncodeString(&ret, "max-bytes-for-level-multiplier");
EncodeInt32(&ret, g_pika_conf->max_bytes_for_level_multiplier());
EncodeString(&ret, "expire-logs-days"); EncodeString(&ret, "expire-logs-days");
EncodeInt32(&ret, g_pika_conf->expire_logs_days()); EncodeInt32(&ret, g_pika_conf->expire_logs_days());
EncodeString(&ret, "expire-logs-nums"); EncodeString(&ret, "expire-logs-nums");
......
...@@ -138,6 +138,11 @@ int PikaConf::Load() ...@@ -138,6 +138,11 @@ int PikaConf::Load()
if (max_cache_files_ < -1) { if (max_cache_files_ < -1) {
max_cache_files_ = 5000; max_cache_files_ = 5000;
} }
max_bytes_for_level_multiplier_ = 10;
GetConfInt("max-bytes-for-level-multiplier", &max_bytes_for_level_multiplier_);
if (max_bytes_for_level_multiplier_ < 10) {
max_bytes_for_level_multiplier_ = 5;
}
// daemonize // daemonize
std::string dmz; std::string dmz;
...@@ -211,6 +216,7 @@ int PikaConf::ConfigRewrite() { ...@@ -211,6 +216,7 @@ int PikaConf::ConfigRewrite() {
SetConfInt("max-background-flushes", max_background_flushes_); SetConfInt("max-background-flushes", max_background_flushes_);
SetConfInt("max-background-compactions", max_background_compactions_); SetConfInt("max-background-compactions", max_background_compactions_);
SetConfInt("max-cache-files", max_cache_files_); SetConfInt("max-cache-files", max_cache_files_);
SetConfInt("max-bytes-for-level-multiplier", max_bytes_for_level_multiplier_);
return WriteBack(); return WriteBack();
} }
...@@ -57,6 +57,7 @@ PikaServer::PikaServer() : ...@@ -57,6 +57,7 @@ PikaServer::PikaServer() :
option.max_background_flushes = g_pika_conf->max_background_flushes(); option.max_background_flushes = g_pika_conf->max_background_flushes();
option.max_background_compactions = g_pika_conf->max_background_compactions(); option.max_background_compactions = g_pika_conf->max_background_compactions();
option.max_open_files = g_pika_conf->max_cache_files(); option.max_open_files = g_pika_conf->max_cache_files();
option.max_bytes_for_level_multiplier = g_pika_conf->max_bytes_for_level_multiplier();
if (g_pika_conf->compression() == "none") { if (g_pika_conf->compression() == "none") {
option.compression = false; option.compression = false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册