Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
149c2459
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
149c2459
编写于
4月 28, 2019
作者:
G
groot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add rocksdb option
Former-commit-id: cebc9569d8dca44c360ac68510427f1447105ddc
上级
0108db98
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
11 deletion
+18
-11
cpp/conf/server_config.yaml
cpp/conf/server_config.yaml
+3
-0
cpp/src/server/ServerConfig.h
cpp/src/server/ServerConfig.h
+6
-3
cpp/src/server/VecIdMapper.cpp
cpp/src/server/VecIdMapper.cpp
+3
-2
cpp/src/server/VecServiceTask.cpp
cpp/src/server/VecServiceTask.cpp
+4
-4
cpp/test_client/src/ClientTest.cpp
cpp/test_client/src/ClientTest.cpp
+2
-2
未找到文件。
cpp/conf/server_config.yaml
浏览文件 @
149c2459
...
...
@@ -3,9 +3,12 @@ server_config:
port
:
33001
transfer_protocol
:
json
#optional: binary, compact, json, debug
server_mode
:
thread_pool
#optional: simple, thread_pool
db_config
:
db_path
:
/tmp/vecwise
db_backend_url
:
http://127.0.0.1
db_flush_interval
:
5
#unit: second
idmapper_max_open_file
:
128
log_config
:
global
:
...
...
cpp/src/server/ServerConfig.h
浏览文件 @
149c2459
...
...
@@ -19,9 +19,12 @@ static const std::string CONFIG_SERVER_ADDRESS = "address";
static
const
std
::
string
CONFIG_SERVER_PORT
=
"port"
;
static
const
std
::
string
CONFIG_SERVER_PROTOCOL
=
"transfer_protocol"
;
static
const
std
::
string
CONFIG_SERVER_MODE
=
"server_mode"
;
static
const
std
::
string
CONFIG_SERVER_DB_URL
=
"db_backend_url"
;
static
const
std
::
string
CONFIG_SERVER_DB_PATH
=
"db_path"
;
static
const
std
::
string
CONFIG_SERVER_DB_FLUSH_INTERVAL
=
"db_flush_interval"
;
static
const
std
::
string
CONFIG_DB
=
"db_config"
;
static
const
std
::
string
CONFIG_DB_URL
=
"db_backend_url"
;
static
const
std
::
string
CONFIG_DB_PATH
=
"db_path"
;
static
const
std
::
string
CONFIG_DB_FLUSH_INTERVAL
=
"db_flush_interval"
;
static
const
std
::
string
CONFIG_DB_IDMAPPER_MAX_FILE
=
"idmapper_max_open_file"
;
static
const
std
::
string
CONFIG_LOG
=
"log_config"
;
...
...
cpp/src/server/VecIdMapper.cpp
浏览文件 @
149c2459
...
...
@@ -91,8 +91,8 @@ ServerError SimpleIdMapper::Delete(const std::string& nid) {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
RocksIdMapper
::
RocksIdMapper
()
{
ConfigNode
&
config
=
ServerConfig
::
GetInstance
().
GetConfig
(
CONFIG_
SERVER
);
std
::
string
db_path
=
config
.
GetValue
(
CONFIG_
SERVER_
DB_PATH
);
ConfigNode
&
config
=
ServerConfig
::
GetInstance
().
GetConfig
(
CONFIG_
DB
);
std
::
string
db_path
=
config
.
GetValue
(
CONFIG_DB_PATH
);
db_path
+=
"/id_mapping"
;
CommonUtil
::
CreateDirectory
(
db_path
);
...
...
@@ -102,6 +102,7 @@ RocksIdMapper::RocksIdMapper() {
options
.
OptimizeLevelStyleCompaction
();
// create the DB if it's not already present
options
.
create_if_missing
=
true
;
options
.
max_open_files
=
config
.
GetInt32Value
(
CONFIG_DB_IDMAPPER_MAX_FILE
,
128
);
// open DB
rocksdb
::
Status
s
=
rocksdb
::
DB
::
Open
(
options
,
db_path
,
&
db_
);
...
...
cpp/src/server/VecServiceTask.cpp
浏览文件 @
149c2459
...
...
@@ -24,10 +24,10 @@ namespace {
public:
DBWrapper
()
{
zilliz
::
vecwise
::
engine
::
Options
opt
;
ConfigNode
&
config
=
ServerConfig
::
GetInstance
().
GetConfig
(
CONFIG_
SERVER
);
opt
.
meta
.
backend_uri
=
config
.
GetValue
(
CONFIG_
SERVER_
DB_URL
);
std
::
string
db_path
=
config
.
GetValue
(
CONFIG_
SERVER_
DB_PATH
);
opt
.
memory_sync_interval
=
(
uint16_t
)
config
.
GetInt32Value
(
CONFIG_
SERVER_
DB_FLUSH_INTERVAL
,
10
);
ConfigNode
&
config
=
ServerConfig
::
GetInstance
().
GetConfig
(
CONFIG_
DB
);
opt
.
meta
.
backend_uri
=
config
.
GetValue
(
CONFIG_DB_URL
);
std
::
string
db_path
=
config
.
GetValue
(
CONFIG_DB_PATH
);
opt
.
memory_sync_interval
=
(
uint16_t
)
config
.
GetInt32Value
(
CONFIG_DB_FLUSH_INTERVAL
,
10
);
opt
.
meta
.
path
=
db_path
+
"/db"
;
CommonUtil
::
CreateDirectory
(
opt
.
meta
.
path
);
...
...
cpp/test_client/src/ClientTest.cpp
浏览文件 @
149c2459
...
...
@@ -41,8 +41,8 @@ namespace {
int32_t
GetFlushInterval
()
{
server
::
ServerConfig
&
config
=
server
::
ServerConfig
::
GetInstance
();
server
::
ConfigNode
server_config
=
config
.
GetConfig
(
server
::
CONFIG_SERVER
);
return
server_config
.
GetInt32Value
(
server
::
CONFIG_SERVER
_DB_FLUSH_INTERVAL
);
server
::
ConfigNode
db_config
=
config
.
GetConfig
(
server
::
CONFIG_DB
);
return
db_config
.
GetInt32Value
(
server
::
CONFIG
_DB_FLUSH_INTERVAL
);
}
std
::
string
GetGroupID
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录