Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
24c39535
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,发现更多精彩内容 >>
未验证
提交
24c39535
编写于
3月 13, 2020
作者:
J
Jin Hai
提交者:
GitHub
3月 13, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1639 from dvzubarev/fix-crashes
Fix crashes with sptag index
上级
45c66b3c
05504188
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
4 deletion
+15
-4
core/src/index/knowhere/knowhere/adapter/SptagAdapter.cpp
core/src/index/knowhere/knowhere/adapter/SptagAdapter.cpp
+2
-1
core/src/index/knowhere/knowhere/common/BinarySet.h
core/src/index/knowhere/knowhere/common/BinarySet.h
+9
-0
core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp
...index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp
+1
-1
core/src/scheduler/job/BuildIndexJob.cpp
core/src/scheduler/job/BuildIndexJob.cpp
+2
-1
core/src/scheduler/job/BuildIndexJob.h
core/src/scheduler/job/BuildIndexJob.h
+1
-1
未找到文件。
core/src/index/knowhere/knowhere/adapter/SptagAdapter.cpp
浏览文件 @
24c39535
...
...
@@ -10,6 +10,7 @@
// or implied. See the License for the specific language governing permissions and limitations under the License.
#include "knowhere/adapter/SptagAdapter.h"
#include "VectorAdapter.h"
namespace
knowhere
{
...
...
@@ -19,7 +20,7 @@ ConvertToMetadataSet(const DatasetPtr& dataset) {
auto
elems
=
dataset
->
Get
<
int64_t
>
(
meta
::
ROWS
);
auto
p_data
=
dataset
->
Get
<
const
int64_t
*>
(
meta
::
IDS
);
auto
p_offset
=
(
int64_t
*
)
malloc
(
sizeof
(
int64_t
)
*
elems
);
auto
p_offset
=
(
int64_t
*
)
malloc
(
sizeof
(
int64_t
)
*
(
elems
+
1
)
);
for
(
auto
i
=
0
;
i
<=
elems
;
++
i
)
p_offset
[
i
]
=
i
*
8
;
std
::
shared_ptr
<
SPTAG
::
MetadataSet
>
metaset
(
...
...
core/src/index/knowhere/knowhere/common/BinarySet.h
浏览文件 @
24c39535
...
...
@@ -11,6 +11,8 @@
#pragma once
#include <string.h>
#include <map>
#include <memory>
#include <string>
...
...
@@ -28,6 +30,13 @@ struct Binary {
};
using
BinaryPtr
=
std
::
shared_ptr
<
Binary
>
;
inline
uint8_t
*
CopyBinary
(
const
BinaryPtr
&
bin
)
{
uint8_t
*
newdata
=
new
uint8_t
[
bin
->
size
];
memcpy
(
newdata
,
bin
->
data
.
get
(),
bin
->
size
);
return
newdata
;
}
class
BinarySet
{
public:
BinaryPtr
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp
浏览文件 @
24c39535
...
...
@@ -104,7 +104,7 @@ CPUSPTAGRNG::Load(const BinarySet& binary_set) {
index_blobs
.
push_back
(
SPTAG
::
ByteArray
(
deleteid
->
data
.
get
(),
deleteid
->
size
,
false
));
auto
metadata1
=
binary_set
.
GetByName
(
"metadata1"
);
index_blobs
.
push_back
(
SPTAG
::
ByteArray
(
metadata1
->
data
.
get
(),
metadata1
->
size
,
fals
e
));
index_blobs
.
push_back
(
SPTAG
::
ByteArray
(
CopyBinary
(
metadata1
),
metadata1
->
size
,
tru
e
));
auto
metadata2
=
binary_set
.
GetByName
(
"metadata2"
);
index_blobs
.
push_back
(
SPTAG
::
ByteArray
(
metadata2
->
data
.
get
(),
metadata2
->
size
,
false
));
...
...
core/src/scheduler/job/BuildIndexJob.cpp
浏览文件 @
24c39535
...
...
@@ -39,9 +39,10 @@ BuildIndexJob::AddToIndexFiles(const engine::meta::TableFileSchemaPtr& to_index_
<<
", location: "
<<
to_index_file
->
location_
;
to_index_files_
[
to_index_file
->
id_
]
=
to_index_file
;
return
true
;
}
Status
&
void
BuildIndexJob
::
WaitBuildIndexFinish
()
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
mutex_
);
cv_
.
wait
(
lock
,
[
this
]
{
return
to_index_files_
.
empty
();
});
...
...
core/src/scheduler/job/BuildIndexJob.h
浏览文件 @
24c39535
...
...
@@ -44,7 +44,7 @@ class BuildIndexJob : public Job, public server::CacheConfigHandler {
bool
AddToIndexFiles
(
const
TableFileSchemaPtr
&
to_index_file
);
Status
&
void
WaitBuildIndexFinish
();
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录