Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
OpenAtomFoundation
pika
提交
399fde46
pika
项目概览
镜像
/
OpenAtomFoundation
/
pika
大约 1 年 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
pika
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
399fde46
编写于
3月 09, 2017
作者:
K
KernelMaker
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
beta-2.2.0
上级
bbc49422
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
25 addition
and
5 deletion
+25
-5
Makefile
Makefile
+5
-2
conf/pika.conf
conf/pika.conf
+3
-1
include/pika_conf.h
include/pika_conf.h
+2
-0
include/pika_define.h
include/pika_define.h
+1
-1
src/pika_admin.cc
src/pika_admin.cc
+7
-1
src/pika_conf.cc
src/pika_conf.cc
+6
-0
src/pika_server.cc
src/pika_server.cc
+1
-0
未找到文件。
Makefile
浏览文件 @
399fde46
...
@@ -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
\
...
...
conf/pika.conf
浏览文件 @
399fde46
...
@@ -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
include/pika_conf.h
浏览文件 @
399fde46
...
@@ -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];
...
...
include/pika_define.h
浏览文件 @
399fde46
...
@@ -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
{
...
...
src/pika_admin.cc
浏览文件 @
399fde46
...
@@ -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
=
"*7
0
\r\n
"
;
ret
=
"*7
2
\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"
);
...
...
src/pika_conf.cc
浏览文件 @
399fde46
...
@@ -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
();
}
}
src/pika_server.cc
浏览文件 @
399fde46
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录