Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
5aecaff4
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,发现更多精彩内容 >>
提交
5aecaff4
编写于
6月 30, 2019
作者:
Z
zhiru
提交者:
jinhai
7月 13, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
Former-commit-id: c371d0147380b15f93d111af3a5aafd7652576b3
上级
de9e663a
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
30 addition
and
15 deletion
+30
-15
cpp/conf/server_config.yaml
cpp/conf/server_config.yaml
+2
-2
cpp/src/db/DBImpl.cpp
cpp/src/db/DBImpl.cpp
+1
-1
cpp/src/db/Factories.cpp
cpp/src/db/Factories.cpp
+7
-6
cpp/src/db/Factories.h
cpp/src/db/Factories.h
+1
-1
cpp/src/db/MySQLMetaImpl.cpp
cpp/src/db/MySQLMetaImpl.cpp
+13
-4
cpp/src/db/MySQLMetaImpl.h
cpp/src/db/MySQLMetaImpl.h
+2
-1
cpp/src/server/DBWrapper.cpp
cpp/src/server/DBWrapper.cpp
+4
-0
未找到文件。
cpp/conf/server_config.yaml
浏览文件 @
5aecaff4
server_config
:
address
:
0.0.0.0
port
:
1953
1
# the port milvus listen to, default: 19530, range: 1025 ~ 65534
port
:
1953
0
# the port milvus listen to, default: 19530, range: 1025 ~ 65534
gpu_index
:
0
# the gpu milvus use, default: 0, range: 0 ~ gpu number - 1
mode
:
cluster
# milvus deployment type: single, cluster
mode
:
single
# milvus deployment type: single, cluster, read_only
db_config
:
db_path
:
/tmp/milvus
...
...
cpp/src/db/DBImpl.cpp
浏览文件 @
5aecaff4
...
...
@@ -136,7 +136,7 @@ DBImpl::DBImpl(const Options& options)
shutting_down_
(
false
),
compact_thread_pool_
(
1
,
1
),
index_thread_pool_
(
1
,
1
)
{
meta_ptr_
=
DBMetaImplFactory
::
Build
(
options
.
meta
);
meta_ptr_
=
DBMetaImplFactory
::
Build
(
options
.
meta
,
options
.
mode
);
mem_mgr_
=
std
::
make_shared
<
MemManager
>
(
meta_ptr_
,
options_
);
// mem_mgr_ = (MemManagerPtr)(new MemManager(meta_ptr_, options_));
if
(
options
.
mode
!=
"read_only"
)
{
...
...
cpp/src/db/Factories.cpp
浏览文件 @
5aecaff4
...
...
@@ -53,7 +53,8 @@ std::shared_ptr<meta::DBMetaImpl> DBMetaImplFactory::Build() {
return
std
::
shared_ptr
<
meta
::
DBMetaImpl
>
(
new
meta
::
DBMetaImpl
(
options
));
}
std
::
shared_ptr
<
meta
::
Meta
>
DBMetaImplFactory
::
Build
(
const
DBMetaOptions
&
metaOptions
)
{
std
::
shared_ptr
<
meta
::
Meta
>
DBMetaImplFactory
::
Build
(
const
DBMetaOptions
&
metaOptions
,
const
std
::
string
&
mode
)
{
std
::
string
uri
=
metaOptions
.
backend_uri
;
// if (uri.empty()) {
...
...
@@ -81,21 +82,21 @@ std::shared_ptr<meta::Meta> DBMetaImplFactory::Build(const DBMetaOptions& metaOp
std
::
string
dialect
=
pieces_match
[
1
].
str
();
std
::
transform
(
dialect
.
begin
(),
dialect
.
end
(),
dialect
.
begin
(),
::
tolower
);
if
(
dialect
.
find
(
"mysql"
)
!=
std
::
string
::
npos
)
{
ENGINE_LOG_
DEBUG
<<
"Using MySQL"
;
return
std
::
make_shared
<
meta
::
MySQLMetaImpl
>
(
meta
::
MySQLMetaImpl
(
metaOptions
));
ENGINE_LOG_
INFO
<<
"Using MySQL"
;
return
std
::
make_shared
<
meta
::
MySQLMetaImpl
>
(
meta
::
MySQLMetaImpl
(
metaOptions
,
mode
));
}
else
if
(
dialect
.
find
(
"sqlite"
)
!=
std
::
string
::
npos
)
{
ENGINE_LOG_DEBUG
<<
"Using SQLite"
;
return
std
::
make_shared
<
meta
::
DBMetaImpl
>
(
meta
::
DBMetaImpl
(
metaOptions
));
}
else
{
LOG
(
ERROR
)
<<
"Invalid dialect in URI: dialect = "
<<
dialect
;
ENGINE_LOG_ERROR
<<
"Invalid dialect in URI: dialect = "
<<
dialect
;
throw
InvalidArgumentException
(
"URI dialect is not mysql / sqlite"
);
}
}
else
{
LOG
(
ERROR
)
<<
"Wrong URI format: URI = "
<<
uri
;
throw
InvalidArgumentException
(
"Wrong URI format"
);
ENGINE_LOG_ERROR
<<
"Wrong URI format: URI = "
<<
uri
;
throw
InvalidArgumentException
(
"Wrong URI format
"
);
}
}
...
...
cpp/src/db/Factories.h
浏览文件 @
5aecaff4
...
...
@@ -28,7 +28,7 @@ struct OptionsFactory {
struct
DBMetaImplFactory
{
static
std
::
shared_ptr
<
meta
::
DBMetaImpl
>
Build
();
static
std
::
shared_ptr
<
meta
::
Meta
>
Build
(
const
DBMetaOptions
&
metaOptions
);
static
std
::
shared_ptr
<
meta
::
Meta
>
Build
(
const
DBMetaOptions
&
metaOptions
,
const
std
::
string
&
mode
);
};
struct
DBFactory
{
...
...
cpp/src/db/MySQLMetaImpl.cpp
浏览文件 @
5aecaff4
...
...
@@ -103,8 +103,9 @@ namespace meta {
return
Status
::
OK
();
}
MySQLMetaImpl
::
MySQLMetaImpl
(
const
DBMetaOptions
&
options_
)
:
options_
(
options_
)
{
MySQLMetaImpl
::
MySQLMetaImpl
(
const
DBMetaOptions
&
options_
,
const
std
::
string
&
mode
)
:
options_
(
options_
),
mode_
(
mode
)
{
Initialize
();
}
...
...
@@ -424,6 +425,14 @@ namespace meta {
}
}
//Scoped Connection
// ConfigNode& serverConfig = ServerConfig::GetInstance().GetConfig(CONFIG_SERVER);
// opt.mode = serverConfig.GetValue(CONFIG_CLUSTER_MODE, "single");
if
(
mode_
!=
"single"
)
{
DeleteTableFiles
(
table_id
);
}
}
catch
(
const
BadQuery
&
er
)
{
// Handle any query errors
ENGINE_LOG_ERROR
<<
"GENERAL ERROR WHEN DELETING TABLE"
<<
": "
<<
er
.
what
();
...
...
@@ -448,10 +457,10 @@ namespace meta {
Query
deleteTableFilesQuery
=
connectionPtr
->
query
();
//
deleteTableFilesQuery
<<
"UPDATE TableFiles "
<<
"SET file_type = "
<<
std
::
to_string
(
TableSchema
::
TO_DELETE
)
<<
", "
<<
"SET file_type = "
<<
std
::
to_string
(
Table
File
Schema
::
TO_DELETE
)
<<
", "
<<
"updated_time = "
<<
std
::
to_string
(
utils
::
GetMicroSecTimeStamp
())
<<
" "
<<
"WHERE table_id = "
<<
quote
<<
table_id
<<
" AND "
<<
"file_type <> "
<<
std
::
to_string
(
TableSchema
::
TO_DELETE
)
<<
";"
;
"file_type <> "
<<
std
::
to_string
(
Table
File
Schema
::
TO_DELETE
)
<<
";"
;
if
(
!
deleteTableFilesQuery
.
exec
())
{
ENGINE_LOG_ERROR
<<
"QUERY ERROR WHEN DELETING TABLE FILES"
;
...
...
cpp/src/db/MySQLMetaImpl.h
浏览文件 @
5aecaff4
...
...
@@ -22,7 +22,7 @@ namespace meta {
class
MySQLMetaImpl
:
public
Meta
{
public:
MySQLMetaImpl
(
const
DBMetaOptions
&
options_
);
MySQLMetaImpl
(
const
DBMetaOptions
&
options_
,
const
std
::
string
&
mode
);
virtual
Status
CreateTable
(
TableSchema
&
table_schema
)
override
;
virtual
Status
DescribeTable
(
TableSchema
&
group_info_
)
override
;
...
...
@@ -77,6 +77,7 @@ namespace meta {
Status
Initialize
();
const
DBMetaOptions
options_
;
const
std
::
string
mode_
;
std
::
shared_ptr
<
MySQLConnectionPool
>
mySQLConnectionPool_
;
bool
safe_grab
=
false
;
...
...
cpp/src/server/DBWrapper.cpp
浏览文件 @
5aecaff4
...
...
@@ -25,6 +25,10 @@ DBWrapper::DBWrapper() {
}
ConfigNode
&
serverConfig
=
ServerConfig
::
GetInstance
().
GetConfig
(
CONFIG_SERVER
);
opt
.
mode
=
serverConfig
.
GetValue
(
CONFIG_CLUSTER_MODE
,
"single"
);
if
(
opt
.
mode
!=
"single"
&&
opt
.
mode
!=
"cluster"
&&
opt
.
mode
!=
"read_only"
)
{
std
::
cout
<<
"ERROR: mode specified in server_config is not one of ['single', 'cluster', 'read_only']"
<<
std
::
endl
;
kill
(
0
,
SIGUSR1
);
}
//set archive config
engine
::
ArchiveConf
::
CriteriaT
criterial
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录